[pypy-svn] r40029 - pypy/dist/pypy/rpython/microbench

antocuni at codespeak.net antocuni at codespeak.net
Wed Mar 7 14:48:28 CET 2007


Author: antocuni
Date: Wed Mar  7 14:48:27 2007
New Revision: 40029

Modified:
   pypy/dist/pypy/rpython/microbench/list.py
Log:
a new microbenchmark showing that boxing *is* an issue



Modified: pypy/dist/pypy/rpython/microbench/list.py
==============================================================================
--- pypy/dist/pypy/rpython/microbench/list.py	(original)
+++ pypy/dist/pypy/rpython/microbench/list.py	Wed Mar  7 14:48:27 2007
@@ -50,7 +50,7 @@
     def loop(obj, i):
         obj[i%1000] = i
 
-class list__iteration:
+class list__iteration__int:
     __metaclass__ = MetaBench
     LOOPS = 100000
     def init():
@@ -63,3 +63,17 @@
         for item in obj:
             tot += item
         return tot
+
+class list__iteration__string:
+    __metaclass__ = MetaBench
+    LOOPS = 100000
+    def init():
+        obj = ['foo']*1000
+        obj[0] = 'bar'
+        return obj
+    args = ['obj']
+    def loop(obj):
+        tot = 0
+        for item in obj:
+            tot += len(item)
+        return tot



More information about the Pypy-commit mailing list