Skip to content

Use zstd for the embedded Python download catalog - #22129

Merged
woodruffw merged 1 commit into
ww/debloat-python-catalogfrom
ww/debloat-python-catalog-zstd
Oct 1, 2026
Merged

woodruffw merged 1 commit into
ww/debloat-python-catalogfrom
ww/debloat-python-catalog-zstd

Conversation

@woodruffw

@woodruffw woodruffw commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Switch the embedded Python catalog to zstd level 19.

Local results against #22126 (aarch64-apple-darwin, Rust 1.98.1):

flate2 zstd
Catalog bytes 306,904 233,814
Stripped binary bytes 40,793,368 40,743,856
Catalog loading 17.93 ms 17.00 ms
Download listing 24.69 ms 23.92 ms

Sizes use release builds with default features, fat LTO, and strip -S -x. Timings are local Criterion wall time: profiling builds, A/B/B/A order, 100 samples per case per run.

Test Plan

fmt, Clippy, 31 download tests, two listing tests, and benchmark smoke tests pass. All catalog records and listing entries match the flate2 build.

Both CodSpeed cases pass local harness checks; no simulation timings were collected.

Compress the catalog at build time with zstd level 19 and use the buffered streaming decoder when loading it. Reuse the locked zstd version with default features disabled.
@woodruffw
woodruffw force-pushed the ww/debloat-python-catalog-zstd branch from df4330b to a21c726 Compare October 1, 2026 16:57
@woodruffw
woodruffw removed this pull request from stack #22127 October 1, 2026 18:17
@woodruffw
woodruffw marked this pull request as ready for review October 1, 2026 18:17
@woodruffw
woodruffw merged commit 3ab6ae5 into ww/debloat-python-catalog Oct 1, 2026
124 checks passed
@woodruffw
woodruffw deleted the ww/debloat-python-catalog-zstd branch October 1, 2026 18:17
woodruffw added a commit that referenced this pull request Oct 1, 2026
Compress the embedded Python catalog with zstd level 19 and decode it before parsing.
woodruffw added a commit that referenced this pull request Oct 1, 2026
Compress the embedded Python catalog with zstd level 19 and decode it before parsing.
woodruffw added a commit that referenced this pull request Oct 1, 2026
## Summary

Compress the embedded Python catalog with zstd level 19 at build time
and decompress it before parsing. The catalog shrinks from 2,611,893 to
233,814 bytes.

Local release builds (`aarch64-apple-darwin`, Rust 1.98.1, default
features, fat LTO):

| Binary | Before (bytes) | After (bytes) | Reduction |
| --- | ---: | ---: | ---: |
| With symbols | 55,017,552 | 52,639,088 | 4.32% |
| `strip -S -x` | 43,138,056 | 40,743,856 | 5.55% |

#22125 adds CodSpeed simulation coverage. #22129 compares zstd with
zlib.

## Test Plan

- Formatting, Clippy, 31 download tests, and two listing integration
tests passed.
- All 5,646 catalog records round-trip; all 2,086 listing entries match
the uncompressed catalog.
- Profiling smoke tests and local CodSpeed harness checks passed.

This branch was previously deployed

1 inactive deployment
automations — a21c726f Deployed Oct 1, 2026 by woodruffw via review / security review #48845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant