[pypy-svn] r23042 - pypy/dist/pypy/translator/microbench

ericvrp at codespeak.net ericvrp at codespeak.net
Sun Feb 5 16:50:57 CET 2006


Author: ericvrp
Date: Sun Feb  5 16:50:56 2006
New Revision: 23042

Modified:
   pypy/dist/pypy/translator/microbench/test_count1.py
Log:
microbenchmark to test LOAD_FAST,LOAD_CONST,BINARY_ADD,STORE_FAST bytecodes



Modified: pypy/dist/pypy/translator/microbench/test_count1.py
==============================================================================
--- pypy/dist/pypy/translator/microbench/test_count1.py	(original)
+++ pypy/dist/pypy/translator/microbench/test_count1.py	Sun Feb  5 16:50:56 2006
@@ -16,6 +16,49 @@
         c += 1
 
 #
+def test_loop_unrolled():
+    '''32x the following bytecodes
+    28 LOAD_FAST                0 (x)
+    31 LOAD_CONST               2 (1)
+    34 BINARY_ADD
+    35 STORE_FAST               0 (x)'''
+    x = 0
+    n = N
+    while x < n:
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+        x = x + 1
+
+#
 def test_count_in_slot():
     class X(object):
         __slots__ = 'x'



More information about the Pypy-commit mailing list