v2.3: Remove redundant BufReaders for decompressing tar archives (backport of #6317)#6453
Merged
brooksprumo merged 1 commit intov2.3from Jun 9, 2025
Merged
v2.3: Remove redundant BufReaders for decompressing tar archives (backport of #6317)#6453brooksprumo merged 1 commit intov2.3from
brooksprumo merged 1 commit intov2.3from
Conversation
brooksprumo
approved these changes
Jun 6, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2.3 #6453 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 848 848
Lines 379479 379477 -2
=========================================
- Hits 314550 314503 -47
- Misses 64929 64974 +45 🚀 New features to boost your workflow:
|
|
@Mergifyio rebase |
* perf: remove redundant BufReaders for decompressing tar archives * Format * Switch bzip2 decoder to read (cherry picked from commit da1b789)
Author
✅ Branch has been successfully rebased |
61f1608 to
8d1fdd8
Compare
kskalski
approved these changes
Jun 9, 2025
t-nelson
approved these changes
Jun 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ZSTD
Decoder::newcreates buf reader with tuned size already, other decoders handle buffering too:BzDecoderhttps://docs.rs/bzip2/latest/src/bzip2/read.rs.html#87-91GzDecoderhttps://docs.rs/flate2/latest/src/flate2/gz/read.rs.html#143-147lz4::Decoderhttps://docs.rs/lz4/1.28.1/src/lz4/decoder.rs.html#33-43 (it uses a vec buffer directly)zstd::Decoderhttps://github.com/gyscos/zstd-rs/blob/229054099aa73f7e861762f687d7e07cac1d9b3b/src/stream/read/mod.rs#L29In those cases wrapping reader with
BufReaderis counter-productive or unnecessary (bzip2 provides bothbufreadandreaddecoders)Summary of Changes
Remove redundant BufReaders for decompressing tar archives when underlying decompressor is already doing buffering.
This is an automatic backport of pull request #6317 done by [Mergify](https://mergify.com).