Message194727
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 |
|
Date |
User |
Action |
Args |
2013-08-09 13:29:51 | pitrou | set | recipients:
+ pitrou, tim.peters, ezio.melotti, mrabarnett, serhiy.storchaka |
2013-08-09 13:29:51 | pitrou | set | messageid: <1376054991.87.0.578167661245.issue18685@psf.upfronthosting.co.za> |
2013-08-09 13:29:51 | pitrou | link | issue18685 messages |
2013-08-09 13:29:51 | pitrou | create | |
|