-
Notifications
You must be signed in to change notification settings - Fork 415
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
Caching compiled re
patterns
#108
Comments
Hmm, I was under the impression that the Python Contributions welcomed -- thanks. As an initial thought, one possibility might be to add (However, we'd need to check how much effect precompiling 300 sets of metadata regexps would have on library startup...) |
Thank you for your response. I might get a chance to look deeper into it in the next week or two. |
The cache in |
Any chance to add an option/flag to compile everything in advance so the package runtime will be faster? Thanks! |
First of all, thank you for creating this Python port.
In my use, I'm checking a large number of short strings to see if they are likely to be a phone number. I found that I'm making a lot of calls to
re.compile()
(for example here). Caching the patterns leads to about a 6-10x speedup for my use case.If this is something that would make sense given the contributing guidelines, I'd be happy to do a PR.
The text was updated successfully, but these errors were encountered: