[pypy-svn] r37538 - pypy/dist/pypy/jit/codegen/demo

mwh at codespeak.net mwh at codespeak.net
Mon Jan 29 14:27:54 CET 2007


Author: mwh
Date: Mon Jan 29 14:27:51 2007
New Revision: 37538

Modified:
   pypy/dist/pypy/jit/codegen/demo/conftest.py
   pypy/dist/pypy/jit/codegen/demo/test_random.py
Log:
conftesterize the iterations too


Modified: pypy/dist/pypy/jit/codegen/demo/conftest.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/demo/conftest.py	(original)
+++ pypy/dist/pypy/jit/codegen/demo/conftest.py	Mon Jan 29 14:27:51 2007
@@ -24,6 +24,11 @@
                default=26,
                dest="n_vars",
                help="supply this many randomly-valued arguments to the function"),
+        Option('--iterations', action="store", type="int",
+               default=0,
+               dest="iterations",
+               help="run the loop of the generated function this many times - "
+                    "the default is backend dependent"),
         )
 
 very_slow_backends = {'llgraph': True,

Modified: pypy/dist/pypy/jit/codegen/demo/test_random.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/demo/test_random.py	(original)
+++ pypy/dist/pypy/jit/codegen/demo/test_random.py	Mon Jan 29 14:27:51 2007
@@ -89,8 +89,12 @@
         'print dummyfn(10000, *args)\n' % (src, args))
     exec src.compile()
 
-    if demo_conftest.option.backend in demo_conftest.very_slow_backends:
-        iterations = 50
+    if demo_conftest.option.iterations != 0:
+        iterations = demo_conftest.option.iterations
     else:
-        iterations = 10000
+        if demo_conftest.option.backend in demo_conftest.very_slow_backends:
+            iterations = 50
+        else:
+            iterations = 10000
+
     rundemo(dummyfn, iterations, *args)



More information about the Pypy-commit mailing list