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

Add a benchmark for regex related practices #5

Merged
merged 1 commit into from
May 28, 2022

Conversation

pamelafox
Copy link
Contributor

The first benchmark compares a regex with start/end anchors and the match method versus a regex with no anchors and the fullmatch method. I believe those should be equivalent functionally and was curious if the performance would vary. I do generally see better performance on the second, but it's usually below 10%, and its not always better, so maybe that benchmark should be thrown away?

The second benchmark compares using re.IGNORECASE with a regex looking for [a-z] versus a regex that specifies [a-zA-Z ] but has no flag. That seems to reliably get good performance improvements (~20-25%).

@tonybaloney
Copy link
Owner

thank you!

@q0w q0w mentioned this pull request Jun 7, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants