[issue18685] Restore re performance to pre-PEP393 level

Matthew Barnett report at bugs.python.org
Fri Aug 9 22:03:01 CEST 2013


Matthew Barnett added the comment:

With the patch the results are:

C:\Python34\python.exe -m timeit -s "import re; f = re.compile(b'abc').search; x = b'x'*100000" "f(x)" 
10000 loops, best of 3: 113 usec per loop

C:\Python34\python.exe -m timeit -s "import re; f = re.compile('abc').search; x = 'x'*100000" "f(x)" 
10000 loops, best of 3: 113 usec per loop

C:\Python34\python.exe -m timeit -s "import re; f = re.compile('abc').search; x = '\u20ac'*100000" "f(x)" 
10000 loops, best of 3: 113 usec per loop

I'm most impressed! :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18685>
_______________________________________


More information about the Python-bugs-list mailing list