Skip to content

Conversation

@mattsu2020
Copy link
Contributor

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

@sylvestre
Copy link
Contributor

i wonder how we could check that in the CI to make sure we don't regress

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@sylvestre
Copy link
Contributor

sorry, small conflict

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 10, 2025

CodSpeed Performance Report

Merging #9215 will not alter performance

Comparing mattsu2020:base64_performance (9170955) with main (a4701f4)

Summary

✅ 127 untouched
⏩ 6 skipped1

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@mattsu2020
Copy link
Contributor Author

#9213

@sylvestre
Copy link
Contributor

given that codspeed didn't detect performance improvement, i guess it is "only" memory usage, no?

@mattsu2020
Copy link
Contributor Author

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.

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@sylvestre
Copy link
Contributor

so, the PR name should be updated, thanks!

@mattsu2020 mattsu2020 changed the title Base64: performance tuning Base64: Memory usage improvements Dec 1, 2025
if byte == b'\n' || byte == b'\r' {
continue;
}
loop {
Copy link
Contributor

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

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

GNU testsuite comparison:

Congrats! The gnu test tests/cksum/cksum-c is no longer failing!

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@mattsu2020 mattsu2020 requested a review from sylvestre December 2, 2025 10:32
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/printf/printf-surprise is now passing!
Note: The gnu test tests/dd/no-allocate was skipped on 'main' but is now failing.
Note: The gnu test tests/misc/write-errors was skipped on 'main' but is now failing.

- Add "hellohello" to ignored words to prevent false positives
- Keeps spell-checker from flagging known test data in base_common.rs
@sylvestre
Copy link
Contributor

I think there is a mistake :)

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@mattsu2020 mattsu2020 closed this Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants