-
-
Notifications
You must be signed in to change notification settings - Fork 535
Precompile common regular expressions #1603
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
Precompile common regular expressions #1603
Conversation
I highly doubt your performance numbers, for instance |
The results I see locally with this change are pretty consistent, dropping about 1s off execution time.
Before
After
|
For very large tox.ini configurations there is a lot of time spent calling re._compile by precompiling these common/static regular expressions I was able to get our `tox -l` run from 7.79s to 6.63s
e073e80
to
542d76a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOs isn't happy but seems unrelated to this PR.
For very large tox.ini configurations there is a lot of time spent calling
re._compile
for static regular expressions. By precompiling these common/static regular expressions I was able to get ourtox -l
run from 7.79s to 6.63sExample of our tox.ini
Thanks for contributing a pull request!
If you are contributing for the first time or provide a trivial fix don't worry too
much about the checklist - we will help you get started.
Contribution checklist:
(also see CONTRIBUTING.rst for details)
in message body
<issue number>.<type>.rst
for example (588.bugfix.rst)<type>
is must be one ofbugfix
,feature
,deprecation
,breaking
,doc
,misc
<your username>
"superuser
."CONTRIBUTORS
(preserving alphabetical order)