summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-02-07 14:40:33 (GMT)
committerBrett Cannon <brett@python.org>2012-02-07 14:40:33 (GMT)
commitcae1068e82229129f1928b37b85e71e24d1ab0a2 (patch)
tree53faeaf48f30c2edd37c0aa11bafbb3d49413102 /Lib
parent3fd6e2b9108e8c2df1b584868c5fc830f2afb7e1 (diff)
downloadcpython-cae1068e82229129f1928b37b85e71e24d1ab0a2.zip
cpython-cae1068e82229129f1928b37b85e71e24d1ab0a2.tar.gz
cpython-cae1068e82229129f1928b37b85e71e24d1ab0a2.tar.bz2
Re-order importlib benchmarks to be consistent. Also print out what implementation of __import__ is used.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/importlib/test/benchmark.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/importlib/test/benchmark.py b/Lib/importlib/test/benchmark.py
index 025bc56..ed88f04 100644
--- a/Lib/importlib/test/benchmark.py
+++ b/Lib/importlib/test/benchmark.py
@@ -165,12 +165,13 @@ def main(import_, filename=None, benchmark=None):
prev_results = {}
__builtins__.__import__ = import_
benchmarks = (from_cache, builtin_mod,
- source_using_bytecode, source_wo_bytecode,
source_writing_bytecode,
- tabnanny_using_bytecode, tabnanny_wo_bytecode,
+ source_wo_bytecode, source_using_bytecode,
tabnanny_writing_bytecode,
- decimal_using_bytecode, decimal_writing_bytecode,
- decimal_wo_bytecode,)
+ tabnanny_wo_bytecode, tabnanny_using_bytecode,
+ decimal_writing_bytecode,
+ decimal_wo_bytecode, decimal_using_bytecode,
+ )
if benchmark:
for b in benchmarks:
if b.__doc__ == benchmark:
@@ -183,9 +184,10 @@ def main(import_, filename=None, benchmark=None):
seconds_plural = 's' if seconds > 1 else ''
repeat = 3
header = ('Measuring imports/second over {} second{}, best out of {}\n'
- 'Entire benchmark run should take about {} seconds\n')
+ 'Entire benchmark run should take about {} seconds\n'
+ 'Using {!r} as __import__\n')
print(header.format(seconds, seconds_plural, repeat,
- len(benchmarks) * seconds * repeat))
+ len(benchmarks) * seconds * repeat, __import__))
new_results = {}
for benchmark in benchmarks:
print(benchmark.__doc__, "[", end=' ')