gh-118761: substitute re import in base64.b16decode for a more efficient alternative#128736
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.
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 <1324225+hugovk@users.noreply.github.com>
base64re 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 <9087854+AA-Turner@users.noreply.github.com>
…8oADD.rst Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
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