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

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Dec 3 17:55:01 CET 2007


Author: cfbolz
Date: Mon Dec  3 17:55:01 2007
New Revision: 49320

Modified:
   pypy/dist/pypy/translator/microbench/test_unicode.py
Log:
a find microbench where pypy is both faster than cpy 2.4 and 2.5. I think I am
hitting the case here where our algorithm is O(len(text)) and theirs is
O(len(text) * len(pattern))


Modified: pypy/dist/pypy/translator/microbench/test_unicode.py
==============================================================================
--- pypy/dist/pypy/translator/microbench/test_unicode.py	(original)
+++ pypy/dist/pypy/translator/microbench/test_unicode.py	Mon Dec  3 17:55:01 2007
@@ -38,3 +38,11 @@
     while i < N:
         i += 1
         u2.find(u"b")
+
+u3 = u"baaaaaaaaaaaaaaa" * 1000
+def test_bad_case_python2_5():
+    p = u"a" * 16 + u"b" + u"a" * 16
+    i = 0
+    while i < 10000:
+        i += 1
+        u3.find(p)



More information about the Pypy-commit mailing list