-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-118761: substitute re
import in base64.b16decode
for a more efficient alternative
#128736
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
Conversation
Importing `base64` is now up to six times faster. The `re` module is now locally imported by `base64.b16decode` and is no more implicitly exposed as `base64.re`.
This entirely removes the needs to a regex.
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.
🚀
Misc/NEWS.d/next/Library/2025-01-10-13-06-54.gh-issue-118761.f8oADD.rst
Outdated
Show resolved
Hide resolved
…8oADD.rst Co-authored-by: Hugo van Kemenade <[email protected]>
base64
re
import in base64.b16decode
for a more efficient alternative
Misc/NEWS.d/next/Library/2025-01-10-13-06-54.gh-issue-118761.f8oADD.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Adam Turner <[email protected]>
…8oADD.rst Co-authored-by: Adam Turner <[email protected]>
Thanks! A |
FYI @picnixz was recently promoted as a core dev and so can merge his own changes. |
(I don't mind others merging my PRs by the way) |
9.5 ms down to 5.7 ms is impressive but not six times - rather 60%? |
hyperfine benchmarks also take into account interpreter's startup and so, while |
Sure, my bad. Importtime itself is of course six times faster. Thank you all for the great work here in cPython! |
Benchmarks are on a RELEASE build (no PGO, no LTO).
See #128736 (comment) for the runtime performance improvements as well.
PR
Main