◐ Shell
clean mode source ↗

gh-101178: refactor base64.b85encode to be memory friendly by romuald · Pull Request #112248 · python/cpython

pitrou

pitrou

Initially done to reduce the huge memory consumption of the previous
implementation for large inputs, and that no memory-friendly python way was
found that did not include a performance regression

This implementation also greatly improve performance in all cases

Signed-off-by: Romuald Brunet <romuald@chivil.com>
Regression was found while testing the new C implementation, when foldspaces
was used with b85encode (since a chunk could end in z without having been
folded)

picnixz

Apply suggestions

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Since j is not unsigned anymore we can reverse the table lookup loop

picnixz