Skip to content

Commit e70d384

Browse files
committed
Print tested versions in benchmark.
1 parent 830a6e6 commit e70d384

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lockbench.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ def threaded(l, test_func, tcount=10):
9494
context_manager,
9595
]
9696

97+
import fastrlock
9798
import sys
9899
from timeit import Timer
99100
from functools import partial
100101

101102
repeat_count = 100000
102103
repeat_count_t = 1000
103104

104-
rlock, flock = ('threading.RLock', RLock()), ('FastRLock', FLock())
105+
rlock, flock = ('threading.RLock', RLock(), "%d.%d.%d" % sys.version_info[:3]), ('FastRLock', FLock(), fastrlock.__version__)
105106
locks = []
106107
args = sys.argv[1:]
107108
if 'rlock' in args:
@@ -114,8 +115,9 @@ def threaded(l, test_func, tcount=10):
114115
repeat_count = max(10, repeat_count // 100)
115116
repeat_count_t = max(5, repeat_count_t // 10)
116117

117-
for name, lock in locks:
118-
print('Testing %s' % name)
118+
for name, lock, version in locks:
119+
print('Testing %s (%s)' % (name, version))
120+
119121
print("sequential (x%d):" % repeat_count)
120122
for function in functions:
121123
timer = Timer(partial(function, lock))

0 commit comments

Comments
 (0)