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

arigo at codespeak.net arigo at codespeak.net
Wed Apr 23 13:34:51 CEST 2008


Author: arigo
Date: Wed Apr 23 13:34:49 2008
New Revision: 54049

Modified:
   pypy/dist/pypy/translator/microbench/test_formatting.py
Log:
Remove the constant-folding that made these benchmarks completely bogus.


Modified: pypy/dist/pypy/translator/microbench/test_formatting.py
==============================================================================
--- pypy/dist/pypy/translator/microbench/test_formatting.py	(original)
+++ pypy/dist/pypy/translator/microbench/test_formatting.py	Wed Apr 23 13:34:49 2008
@@ -2,8 +2,9 @@
 
 def test_simple_formatting():
     i = 0
+    tup = ('foo', 'bar', 'baz')
     while i < iterations:
-        '%s - %s - %s' % ('foo', 'bar', 'baz')
+        '%s - %s - %s' % tup
         i += 1
 
 def test_dict_formatting():
@@ -15,8 +16,9 @@
 
 def test_number_formatting():
     i = 0
+    tup = (10, 10.1234, 10.1234)
     while i < iterations:
-        '%04d %g %2f' % (10, 10.1234, 10.1234)
+        '%04d %g %2f' % tup
         i += 1
 
 def test_repr_formatting():
@@ -28,12 +30,14 @@
 
 def test_format_unicode():
     i = 0
+    tup = (u'foo', u'bar')
     while i < iterations:
-        '%s %s' % (u'foo', u'bar')
+        '%s %s' % tup
         i += 1
 
 def test_format_long():
     i = 0
+    tup = (100000000000L,)
     while i < iterations:
-        '%d' % (100000000000L,)
+        '%d' % tup
         i += 1



More information about the Pypy-commit mailing list