Skip to content

Use uncompressed editable wheels - #1999

Closed
zaniebot wants to merge 1 commit into
mainfrom
zb/use-uncompressed-editable-wheels
Closed

zaniebot wants to merge 1 commit into
mainfrom
zb/use-uncompressed-editable-wheels

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Editable wheels currently use the normal Deflate writer even though the backend has an uncompressed writer for them. Route build_editable through that writer so the temporary wheel entries use Stored compression. Regular wheel compression and the installed file contents are unchanged.

Local release benchmarks against the exact parent reduce time in build_editable by 7.8% (95% CI 5.8–9.7%) for a minimal package and 6.8% (95% CI 3.5–11.6%) for built-by-uv. A same-process comparison and CPU timings support the savings; forced uv sync reinstalls did not show a measurable end-to-end improvement. Detailed benchmarks.

@codspeed

codspeed Bot commented Sep 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 41 untouched benchmarks


Comparing zb/use-uncompressed-editable-wheels (d3939e5) with main (8bbedb8)

Open in CodSpeed

@zaniebot

zaniebot commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared the exact parent 02fc3badaca322d50cb5d200be5b7dd6bf6f0224 with d3939e5d1cd864e7aa1d2963c8a08adb9e895d37. Fresh release builds support a small speedup in build_editable; the full uv sync measurements remain inconclusive.

Built with Rust 1.98.1 on macOS arm64. The backend measurements use the release profile; the full CLI uses the optimized profiling profile. The release comparison used two runs of 32 randomized ABBA/BAAB groups, the same-process comparison used three runs of 40 groups, and uv sync used two runs of 24 groups. The groups, rather than individual builds, are the sampling units. Changes below are changes in mean elapsed time, with negative values meaning faster. Brackets are 95% confidence intervals from 50,000 hierarchical bootstrap resamples of runs and four-group blocks.

Measurement Parent → PR Change [95% CI]
build_editable, minimal 0.399 → 0.368 ms -7.8% [-9.7%, -5.8%]
build_editable, built-by-uv 1.373 → 1.280 ms -6.8% [-11.6%, -3.5%]
build_editable, README-heavy 0.481 → 0.413 ms -14.1% [-17.4%, -10.8%]
Regular-wheel control 2.160 → 2.148 ms -0.6% [-4.7%, +2.8%]
Identical release-binary control 1.173 → 1.169 ms -0.3% [-2.6%, +2.1%]
uv sync, one editable 51.459 → 53.263 ms +3.5% [-0.1%, +7.1%]
uv sync, 32 editables 186.039 → 189.247 ms +1.7% [-0.5%, +4.2%]
uv sync, regular-wheel control 238.683 → 236.283 ms -1.0% [-4.5%, +2.6%]
uv sync, identical-binary control 225.073 → 234.679 ms +4.3% [+0.1%, +8.7%]

The minimal and built-by-uv release results also exclude zero at 99% confidence: elapsed-time changes of −10.1% to −5.3%, and −13.2% to −2.6%, respectively.

To isolate compression from differences between binaries, a local benchmark exposes both compression modes through the same compiled function and alternates them against the same output path. Its wall-time reductions were 6.2% (95% CI 5.2–7.1%) for the minimal package, 7.9% (95% CI 6.2–10.1%) for built-by-uv, and 14.2% (95% CI 12.3–16.1%) for the README-heavy fixture. Process CPU time fell 6.8% (95% CI 6.2–7.5%) and 6.6% (95% CI 5.4–7.8%) on the first two fixtures. The identical-work controls all include zero.

The instrumented Deflate and Stored archives were byte-identical to the corresponding unmodified parent and PR archives for all three fixtures. Extracted file contents matched, regular wheels remained byte-identical, and tests::editable_wheel_compression passed. The README-heavy fixture is a minimal package using uv’s repository README; the 32-project workspace is synthetic.

The uv sync runs used Python 3.12.12, an existing virtual environment, --offline --no-cache, and forced reinstalls. Debug traces confirmed one or 32 direct builds on each revision, and installed imports succeeded. The identical-binary uv sync control moved by 4.3%, so the smaller end-to-end differences should be treated as noise. These measurements support the backend optimization without establishing a user-visible uv sync speedup. CodSpeed’s existing report reports 41 unchanged benchmarks and has no direct build_editable benchmark.

@zaniebot zaniebot added risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. size:1 Small: one localized behavior with straightforward tests or documentation checks. labels Sep 22, 2026
@zanieb
zanieb marked this pull request as ready for review September 22, 2026 19:00
@astral-automations-bot

Copy link
Copy Markdown

Promoted to #21918.

charliermarsh pushed a commit to astral-sh/uv that referenced this pull request Sep 22, 2026
Editable wheels currently use the normal Deflate writer even though the
backend has an uncompressed writer for them. Route `build_editable`
through that writer so the temporary wheel entries use Stored
compression. Regular wheel compression and the installed file contents
are unchanged.

Local release benchmarks against the exact parent reduce time in
`build_editable` by 7.8% (95% CI 5.8–9.7%) for a minimal package and
6.8% (95% CI 3.5–11.6%) for `built-by-uv`. A same-process comparison and
CPU timings support the savings; forced `uv sync` reinstalls did not
show a measurable end-to-end improvement. [Detailed
benchmarks](astral-sh#1999 (comment)).

Co-authored-by: zaniebot <[email protected]>
@zaniebot zaniebot added the project:maintainer-followups Maintainer follow-up work label Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. project:maintainer-followups Maintainer follow-up work risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. size:1 Small: one localized behavior with straightforward tests or documentation checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant