@@ -57,7 +57,7 @@ code slips in accidentally.
57
57
How fast is it?
58
58
---------------
59
59
60
- Here are some timings for Python 2.7 for the following scenarios:
60
+ Here are some timings for the following scenarios:
61
61
62
62
1) five acquire-release cycles ('lock_unlock')
63
63
2) five acquire calls followed by five release calls (nested locking, 'reentrant_lock_unlock')
@@ -71,59 +71,7 @@ substantially slower for both locks and the benchmark includes the thread
71
71
creation time, so I only looped 1000x here to get useful
72
72
timings instead of 100000x for the single threaded case.
73
73
74
- ::
75
-
76
- Testing _RLock (2.7.18)
77
-
78
- sequential (x100000):
79
- lock_unlock : 853.55 msec
80
- reentrant_lock_unlock : 684.52 msec
81
- mixed_lock_unlock : 758.27 msec
82
- lock_unlock_nonblocking : 860.40 msec
83
- context_manager : 2876.00 msec
84
-
85
- threaded 10T (x1000):
86
- lock_unlock : 2210.69 msec
87
- reentrant_lock_unlock : 1864.38 msec
88
- mixed_lock_unlock : 1963.10 msec
89
- lock_unlock_nonblocking : 3709.91 msec
90
- context_manager : 2640.32 msec
91
-
92
- Testing FastRLock (0.8.1)
93
-
94
- sequential (x100000):
95
- lock_unlock : 139.76 msec
96
- reentrant_lock_unlock : 137.56 msec
97
- mixed_lock_unlock : 140.75 msec
98
- lock_unlock_nonblocking : 164.64 msec
99
- context_manager : 593.06 msec
100
-
101
- threaded 10T (x1000):
102
- lock_unlock : 1621.13 msec
103
- reentrant_lock_unlock : 1807.09 msec
104
- mixed_lock_unlock : 1834.21 msec
105
- lock_unlock_nonblocking : 1642.06 msec
106
- context_manager : 1730.29 msec
107
-
108
- Testing Cython interface of FastRLock (0.8.1)
109
-
110
- sequential (x100000):
111
- lock_unlock : 19.14 msec
112
- reentrant_lock_unlock : 19.12 msec
113
- mixed_lock_unlock : 16.81 msec
114
- lock_unlock_nonblocking : 14.49 msec
115
-
116
- threaded 10T (x1000):
117
- lock_unlock : 1511.85 msec
118
- reentrant_lock_unlock : 1541.96 msec
119
- mixed_lock_unlock : 1585.70 msec
120
- lock_unlock_nonblocking : 1585.35 msec
121
-
122
-
123
- How does it compare to Python 3.7 and later?
124
- --------------------------------------------
125
-
126
- The results here are more mixed. Depending on the optimisation of the CPython
74
+ The results here are mixed. Depending on the optimisation of the CPython
127
75
installation, it can be faster, about the same speed, or somewhat slower.
128
76
In any case, the direct Cython interface is always faster than going through
129
77
the Python API, because it avoids the Python call overhead and executes
0 commit comments