-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Pre-compile nearly all regex patterns #82
Pre-compile nearly all regex patterns #82
Conversation
@@ -64,7 +64,7 @@ def test_sphinxlint_shall_not_pass(file, expected_errors, capsys): | |||
assert expected_error in out | |||
number_of_expected_errors = len(expected_errors) | |||
number_of_reported_errors = len(out.splitlines()) | |||
assert number_of_expected_errors == number_of_reported_errors | |||
assert number_of_expected_errors == number_of_reported_errors, f"{number_of_reported_errors=}, {out=}" |
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.
Not an optimisation, but I found this quite helpful for debugging test failures on my first commit in this PR! Happy to take this out if you prefer, though; I accidentally committed it here 😆
Thanks for the review @ezio-melotti! Just pushed a couple more changes, if you want to take another quick look over :) |
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.
On macOS, time sphinx-lint Doc
on CPython on main
is 1.819s, with this PR 1.567s, 14% faster.
Co-authored-by: Hugo van Kemenade <[email protected]>
None of these changes makes a signficant difference by itself. But taken together, I measure around a 9% speedup over
main
currently! Part of #76