Author pitrou
Recipients ezio.melotti, mrabarnett, pitrou, serhiy.storchaka, tim.peters
Date 2013-08-09.13:29:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376054991.87.0.578167661245.issue18685@psf.upfronthosting.co.za>
In-reply-to
Content
I get the same kind of results as Serhiy:

$ python3.2 -m timeit -s "import re; f = re.compile(b'abc').search; x = b'x'*100000"  "f(x)"
10000 loops, best of 3: 81.7 usec per loop
$ python3.2 -m timeit -s "import re; f = re.compile('abc').search; x = 'x'*100000"  "f(x)"
10000 loops, best of 3: 31.1 usec per loop
$ python3.2 -m timeit -s "import re; f = re.compile('abc').search; x = '\u20ac'*100000"  "f(x)"
10000 loops, best of 3: 31.1 usec per loop

Unpatched 3.4:

$ ./python -m timeit -s "import re; f = re.compile(b'abc').search; x = b'x'*100000"  "f(x)"
10000 loops, best of 3: 81.6 usec per loop
$ ./python -m timeit -s "import re; f = re.compile('abc').search; x = 'x'*100000"  "f(x)"
10000 loops, best of 3: 163 usec per loop
$ ./python -m timeit -s "import re; f = re.compile('abc').search; x = '\u20ac'*100000"  "f(x)"
10000 loops, best of 3: 190 usec per loop

Patched 3.4:

$ ./python -m timeit -s "import re; f = re.compile(b'abc').search; x = b'x'*100000"  "f(x)"
10000 loops, best of 3: 54.4 usec per loop
$ ./python -m timeit -s "import re; f = re.compile('abc').search; x = 'x'*100000"  "f(x)"
10000 loops, best of 3: 54.2 usec per loop
$ ./python -m timeit -s "import re; f = re.compile('abc').search; x = '\u20ac'*100000"  "f(x)"
10000 loops, best of 3: 54.5 usec per loop
History
Date User Action Args
2013-08-09 13:29:51pitrousetrecipients: + pitrou, tim.peters, ezio.melotti, mrabarnett, serhiy.storchaka
2013-08-09 13:29:51pitrousetmessageid: <1376054991.87.0.578167661245.issue18685@psf.upfronthosting.co.za>
2013-08-09 13:29:51pitroulinkissue18685 messages
2013-08-09 13:29:51pitroucreate