-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(Basenc):fix GNU coreutils test bounded-memory.sh #9536
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
CodSpeed Performance ReportMerging #9536 will degrade performances by 2.88%Comparing Summary
Benchmarks breakdown
Footnotes
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Kudos ! A few remarks however:
|
GNU basenc bounded-memory failed because the Rust impl buffered entire input and exceeded the vmem limit. Stream base32/base64 via BufReader and chunked encode/decode so the working set stays around 8 KiB. Keep base58 buffered to preserve its big-integer semantics. Flush already-decoded bytes before returning errors to match GNU output.
645bd1e to
d5cc32b
Compare
|
GNU testsuite comparison: |
|
Ok, I like this ! I looked at the benchmark regression, and it seems that the problem come from the new We can merge this as is, because it's not trivial to avoid memsets in Rust and this MR was about fixing a GNU test anyway, but I think we should keep track of this with an issue @mattsu2020 tell me if you'd rather want this to be addressed in another PR. Anyway, thank you for your contribution ! |
I believe it would be more appropriate to address this matter in a separate pull request. Merging it would likely make handling it more difficult. |
|
@mattsu2020 I created the issue: #9621 |
Summary
basenc: Stream base32/base64 I/O to honor bounded-memory test
The GNU bounded-memory implementation exceeded memory limits when handling all inputs. Using BufReader with chunked encoding/decoding, we consistently kept the working set under 8KiB. During errors, we flush partial outputs to match GNU's behavior.
Modified the test for bounded-memory.sh in GNU coreutils to pass.
related
#9127