Author serhiy.storchaka
Recipients ezio.melotti, mrabarnett, python-dev, serhiy.storchaka, vstinner
Date 2017-04-05.18:36:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491417410.14.0.532594214005.issue28765@psf.upfronthosting.co.za>
In-reply-to
Content
The patch makes some operations slightly faster.

$ ./python -m perf timeit -s 'import re; m = re.match(r"(?P<int>\d+)(?:\.(?P<frac>\d*))?", "12.34")' -- --duplicate 100 'm.lastgroup'
Unpatched:  Median +- std dev: 204 ns +- 1 ns
Patched:    Median +- std dev: 167 ns +- 2 ns

$ ./python -m perf timeit -s 'import re; m = re.match(r"(?P<int>\d+)(?:\.(?P<frac>\d*))?", "12.34")' -- --duplicate 100 'm.groupdict()'
Unpatched:  Median +- std dev: 2.78 us +- 0.05 us
Patched:    Median +- std dev: 1.98 us +- 0.04 us

$ ./python -m perf timeit -s 'import re; m = re.match(r"(?P<int>\d+)(?:\.(?P<frac>\d*))?", "12.34")' -- --duplicate 100 'm.start("frac")'
Unpatched:  Median +- std dev: 638 ns +- 22 ns
Patched:    Median +- std dev: 576 ns +- 16 ns

$ ./python -m perf timeit -s 'import re; m = re.match(r"(?P<int>\d+)(?:\.(?P<frac>\d*))?", "12.34")' -- --duplicate 100 'm.group("frac")'
Unpatched:  Median +- std dev: 1.15 us +- 0.03 us
Patched:    Median +- std dev: 1.07 us +- 0.03 us
History
Date User Action Args
2017-04-05 18:36:50serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, ezio.melotti, mrabarnett, python-dev
2017-04-05 18:36:50serhiy.storchakasetmessageid: <1491417410.14.0.532594214005.issue28765@psf.upfronthosting.co.za>
2017-04-05 18:36:50serhiy.storchakalinkissue28765 messages
2017-04-05 18:36:50serhiy.storchakacreate