Repository navigation
Inflate with flate2's zlib-rs backend - #5
Merged
Merged
Conversation
flate2 now runs on zlib-rs, a Rust port of zlib, instead of its default miniz_oxide, with runtime_detection so zlib-rs picks its SIMD paths (AVX2 on x86-64) on the machine it runs on. The dependency tree goes from six crates to two (flate2, zlib-rs). Unlike miniz_oxide, zlib-rs uses unsafe internally; the README, crate docs and Cargo.toml now say so, and zipview's own code still forbids it. 16 MiB of text: M4 925 -> 2357 MB/s, i7-8700K 681 -> 2099; 2,000 entries of ~4 KiB: M4 421 -> 935 MB/s, i7-8700K 250 -> 639. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
What
flate2now runs on itszlib-rsbackend, a Rust port of zlib, instead of its defaultminiz_oxide. It usesdefault-features = false, features = ["zlib-rs", "runtime_detection"].runtime_detectionturns on zlib-rs'sstdfeature, so it detects the CPU's SIMD support (AVX2 and BMI on x86-64) at runtime. Without it the x86 gain was only about 15%.flate2andzlib-rs.miniz_oxide,adler2,simd-adler32,crc32fastandcfg-ifare gone.Cargo.lockandfuzz/Cargo.lockare updated.miniz_oxide,zlib-rsusesunsafeinternally for its SIMD paths. The README's Design section, the crate docs' Hardening section and theCargo.tomlcomment now say so. zipview's own code is still#![forbid(unsafe_code)].Measured (fastest round,
examples/bench.rs)Correctness
inflate_holds_streams_to_their_declared_size. That test covers too-long, too-short, truncated, trailing-junk and garbage streams.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo testandcargo test --docpass on aarch64-apple-darwin and x86_64-linux.🤖 Generated with Claude Code