-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Base64: Memory usage improvements #9215
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
|
i wonder how we could check that in the CI to make sure we don't regress |
|
GNU testsuite comparison: |
|
sorry, small conflict |
CodSpeed Performance ReportMerging #9215 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
|
given that codspeed didn't detect performance improvement, i guess it is "only" memory usage, no? |
Performance remains unchanged while reducing memory usage, so codespeed shows nothing. |
|
GNU testsuite comparison: |
|
so, the PR name should be updated, thanks! |
src/uu/base32/src/base_common.rs
Outdated
| if byte == b'\n' || byte == b'\r' { | ||
| continue; | ||
| } | ||
| loop { |
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.
dedup the code from line 487
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
fbfc951 to
82c49c1
Compare
- Add "hellohello" to ignored words to prevent false positives - Keeps spell-checker from flagging known test data in base_common.rs
82c49c1 to
9170955
Compare
|
I think there is a mistake :) |
|
GNU testsuite comparison: |
Summary
Reworked base_common streaming so base64/basenc no longer slurp stdin into RAM; both encoder/decoder now read from any Read stream with bounded buffers, keep line-wrapping support, and reuse the SIMD wrapper.
Tightened the Base64SimdWrapper integration and added regression tests that cover streaming encode/decode behaviors plus chunked readers.
Fixed Clippy’s elidable lifetime warning and ensured Base58 handling no longer triggers gigantic buffer allocations.
Testing
cargo test -p uu_base32
cargo test -p uu_base64
cargo test -p uu_basenc
/usr/bin/time -l sh -c "cat benchmarks/bench_500mb.bin | /usr/bin/base64 > /dev/null" → max RSS 1.85 MB
/usr/bin/time -l sh -c "cat benchmarks/bench_500mb.bin | ./target/release/base64 > /dev/null" → max RSS 2.38 MB
/usr/bin/time -l sh -c "cat benchmarks/bench_500mb.b64 | /usr/bin/base64 -D > /dev/null" → max RSS 1.85 MB
/usr/bin/time -l sh -c "cat benchmarks/bench_500mb.b64 | ./target/release/base64 -d > /dev/null" → max RSS 2.33 MB