[pypy-svn] r35750 - pypy/dist/pypy/translator/goal
ac at codespeak.net
ac at codespeak.net
Thu Dec 14 16:57:56 CET 2006
Author: ac
Date: Thu Dec 14 16:57:56 2006
New Revision: 35750
Modified:
pypy/dist/pypy/translator/goal/richards.py
Log:
Make richards use the jit if it is there.
Modified: pypy/dist/pypy/translator/goal/richards.py
==============================================================================
--- pypy/dist/pypy/translator/goal/richards.py (original)
+++ pypy/dist/pypy/translator/goal/richards.py Thu Dec 14 16:57:56 2006
@@ -413,6 +413,20 @@
print "Total time for %d iterations: %.2f secs" %(iterations,total_s)
print "Average time per iteration: %.2f ms" %(total_s*1000/iterations)
+try:
+ import pypyjit
+except ImportError:
+ pass
+else:
+ import types
+ for item in globals().values():
+ if isinstance(item, types.FunctionType):
+ pypyjit.enable(item.func_code)
+ elif isinstance(item, type):
+ for it in item.__dict__.values():
+ if isinstance(it, types.FunctionType):
+ pypyjit.enable(it.func_code)
+
if __name__ == '__main__':
import sys
if len(sys.argv) >= 2:
More information about the pypy-svn
mailing list