[pypy-svn] r49834 - pypy/dist/pypy/translator/microbench
pedronis at codespeak.net
pedronis at codespeak.net
Sun Dec 16 14:01:21 CET 2007
Author: pedronis
Date: Sun Dec 16 14:01:20 2007
New Revision: 49834
Modified:
pypy/dist/pypy/translator/microbench/microbench.py
Log:
just because, don't use exec, it should not make a huge difference but even very fractionally benchmarking the compiler is strange
Modified: pypy/dist/pypy/translator/microbench/microbench.py
==============================================================================
--- pypy/dist/pypy/translator/microbench/microbench.py (original)
+++ pypy/dist/pypy/translator/microbench/microbench.py Sun Dec 16 14:01:20 2007
@@ -25,16 +25,17 @@
break
else:
continue
- testcase = microbench + '.' + k + '()'
+ testcase_name = microbench + '.' + k + '()'
+ testcase = getattr(globals()[microbench], k)
gc.collect()
start = time.clock()
n = 0
duration = 0.0
while duration < MINIMUM_MICROBENCH_TIME:
- exec testcase
+ testcase()
n += 1
duration = time.clock() - start
- print '%s took %.2f seconds' % (testcase, duration / float(n))
+ print '%s took %.2f seconds' % (testcase_name, duration / float(n))
if __name__ == '__main__':
args = sys.argv[1:]
More information about the Pypy-commit
mailing list