coreutils
coreutils copied to clipboard
base(nc|32|64): Optimize performances reduction memset
Summary
- Allocate read buffers with capacity and reuse their spare capacity to avoid zeroing overhead in fast encode/decode paths.
- Switch fast encode/decode to read into spare capacity via
slice::from_raw_parts_mut, keeping safety comments to document the initialization guarantees. - Tidy base_common.rs imports for consistency.
related https://github.com/uutils/coreutils/issues/9621
CodSpeed Performance Report
Merging #9632 will improve performances by 3.15%
Comparing mattsu2020:base32_performance_check (27b72b4) with main (2000af8)
Summary
⚡ 2 improvements
✅ 125 untouched
⏩ 6 skipped[^skipped]
Benchmarks breakdown
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | b64_decode_synthetic |
169.8 µs | 164.6 µs | +3.15% |
| ⚡ | b64_decode_ignore_garbage_synthetic |
169.7 µs | 164.6 µs | +3.14% |
| [^skipped]: 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. |
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
i am not a fan of adding unsafe. would it be possible to find another way? thanks
GNU testsuite comparison:
Congrats! The gnu test tests/cksum/cksum is no longer failing!
is it ready for review?
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)