Repository navigation
Switch flate2 to the zlib-rs backend - #1020
Merged
Merged
Conversation
The `zlib-rs` backend is the fastest `flate2` backend, and being pure Rust it doesn't depend on a C toolchain, so cross-compiles without issue (unlike `zlib-ng`). See: - https://github.com/rust-lang/flate2-rs#backends - https://trifectatech.org/blog/zlib-rs-is-faster-than-c/ The `runtime_detection` feature has to be enabled explicitly, since it's one of the default features disabled by `default-features = false`, and is required for runtime CPU feature detection (and so SIMD acceleration) in `zlib-rs`. This also unblocks buildpacks that use the `tar` feature from switching to `zlib-rs` themselves, since when both features are enabled `zlib` takes precedence over `zlib-rs`. GUS-W-24154015.
edmorley
marked this pull request as ready for review
October 2, 2026 13:26
edmorley
enabled auto-merge (squash)
October 2, 2026 13:27
runesoerensen
approved these changes
Oct 2, 2026
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.
The
zlib-rsbackend is the fastestflate2backend, and being pure Rust it doesn't depend on a C toolchain, so cross-compiles without issue (unlikezlib-ng). See:The
runtime_detectionfeature has to be enabled explicitly, since it's one of the default features disabled bydefault-features = false, and is required for runtime CPU feature detection (and so SIMD acceleration) inzlib-rs.This also unblocks buildpacks that use the
tarfeature from switching tozlib-rsthemselves, since when both features are enabledzlibtakes precedence overzlib-rs.GUS-W-24154015.