perf(rust): evaluate gzip backend after installer optimization - #2678
mohamedmansour wants to merge 3 commits into
Conversation
Use flate2's zlib-rs runtime backend and decode embedded slices directly. Keep build-time compression and installer verification behavior unchanged; cover gzip boundaries and malformed inputs.\n\nRefs github#2677 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused backend optimization preserves existing behavior and includes appropriate regression coverage.
Pull request overview
Optimizes Rust bundled gzip extraction without changing installer behavior or public APIs.
Changes:
- Enables flate2’s
zlib-rsruntime backend. - Uses
bufread::GzDecoderfor embedded byte slices. - Adds gzip integrity and extraction regression tests.
File summaries
| File | Description |
|---|---|
rust/src/embeddedcli.rs |
Updates decoding paths and adds contract tests. |
rust/Cargo.toml |
Selects the optional zlib-rs backend. |
rust/Cargo.lock |
Locks zlib-rs 0.6.8. |
Review details
- Files reviewed: 2/3 changed files
- Comments generated: 0
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
The underlying installer performance problem is real, but I recommend addressing the architectural cost first without adding a new decompression backend. After that work lands, benchmark cold, warm, and repair paths again and compare release binary sizes. If raw inflate time is still material, Generated by Copilot |
Use backend-neutral ZIP features with zlib-rs. Exercise the shared ZIP extractor on every test host and run ZIP/gzip installer coverage in native bundled CI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Decision: Closed in favor of the miniz-only architectural improvements in #2676. We are not pursuing zlib-rs.
Proof: In the matched macOS benchmark, the architecture alone makes cold installation 27% faster, warm verification 46% faster, and repairs 23-24% faster. Warm retained physical memory falls from 174.35 to 1.76 MiB. Measured revisions:
9553d522to4ab7f873.Safety: Keep the existing backend, bounded streaming, trusted file verification, and repair behavior. Native Windows/Linux validation remains tracked in #2676. Full measurements and reproduction.