Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-30340: Enhanced regular expressions optimization. #1542

Merged

Conversation

serhiy-storchaka
Copy link
Member

This increased the performance of matching some patterns up to 25 times.

This increased the performance of matching some patterns up to 25 times.
@serhiy-storchaka serhiy-storchaka added the performance Performance or resource usage label May 11, 2017
@mention-bot
Copy link

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @niemeyer, @birkenfeld and @rhettinger to be potential reviewers.

@serhiy-storchaka serhiy-storchaka merged commit 821a9d1 into python:master May 14, 2017
@serhiy-storchaka serhiy-storchaka deleted the re-parse-optimize-groups branch May 14, 2017 05:32
mschwager added a commit to duo-labs/dlint that referenced this pull request Dec 28, 2019
$ python --version
Python 3.6.9
$ time python -c "import re; re.search(r'([a-c]|[c-e])+z', 'c' * 64)"
*Spins*...
$ time python -c "import re; re.search(r'(c|[c-e])+z', 'c' * 64)"
*Spins*...

$ python --version
Python 3.7.4
$ time python -c "import re; re.search(r'([a-c]|[c-e])+z', 'c' * 64)"
real	0m 0.09s
user	0m 0.07s
sys	0m 0.01s
$ time python -c "import re; re.search(r'(c|[c-e])+z', 'c' * 64)"
real	0m 0.04s
user	0m 0.03s
sys	0m 0.01s

For more information see python/cpython#1542
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants