Repository navigation
Reduce build metadata allocations and code size - #2723
Draft
charliermarsh wants to merge 8 commits into
Draft
charliermarsh wants to merge 8 commits into
charliermarsh wants to merge 8 commits into
Conversation
Merging this PR will not alter performance
|
astral-automations-bot
Bot
force-pushed
the
charlie/codex-uv-build-metadata-size
branch
from
October 15, 2026 03:02
55b34aa to
70dd423
Compare
astral-automations-bot
Bot
force-pushed
the
charlie/codex-uv-build-metadata-size
branch
from
October 19, 2026 21:50
70dd423 to
9fe30be
Compare
This branch was successfully deployed
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.
Generating and parsing build metadata creates intermediate allocations and uses several generic paths. Deserialize author/maintainer tables once, share table parsing for README/license fields, and share author/maintainer formatting. The shared value decoder retains ignored unsigned integers beyond
i64::MAXand the original errors for out-of-range integers.Render dependency strings directly into the final metadata lists, and use the backend's fixed
py3-none-anytags without constructing a wheel filename for metadata-only hooks. Boxing the large TOML and validation error payloads also reduces the backend error enum from 112 to 88 bytes on x86_64.Measurements of an earlier pinned revision. Hyperfine 2.0.0 measurements of 725b74bff → 55b34aaf9 used release builds of the complete CLI with
rustc 1.99.0 (b940084d7 2026-09-28)on an AMD EPYC-Genoa Linux VM, pinned to four CPUs. Output went to/dev/null. The PR head at report preparation was70dd423a1; the measured head was55b34aaf9.Commands invoke
uv build-backendwith the case-specific hook,--directory PROJECT, and a separate output directory. Synthetic projects vary dependency metadata, extras, contacts, scripts, and README size. Direct backend metadata, wheel, editable, and source-distribution hooks include project parsing, metadata generation, and output writes; dependency strings are not resolved or installed. Output directories are cleared outside wall time and RSS; OS pages are warm. No Python interpreter runs inside the measured backend hook.SOURCE_DATE_EPOCHand input timestamps are fixed.Values are means, parent → head. Changes are
(head / parent - 1)with 95% confidence intervals; negative values indicate a reduction.Each workload used ten comparison blocks with alternating revision order, one warmup followed by three measured runs per revision in each block (30 measurements per revision). The pointwise 95% percentile-bootstrap intervals use 20,000 resamples of paired block means and retain all samples. They estimate within-run uncertainty, not variation across machines, independent builds, or separate benchmark campaigns.
Three hook workloads reduced elapsed time by 1.74–2.89%. The contact-only metadata case increased it by 1.85%; the other four runtime intervals include zero. Four metadata-hook workloads reduced peak RSS by 0.19–0.28 MiB; the remaining four RSS intervals include zero. These results apply to the earlier pinned source pair shown above. RSS is Hyperfine's Linux
wait4peak, not an allocation count or summed simultaneous process-tree memory.Earlier measurements
Earlier binary-size study:
On Linux x86_64 with Rust 1.99.0 and the stripped
minimal-sizeprofile,uv-builddecreases from 3,301,624 to 3,287,160 bytes (14,464 bytes, 0.44%) againstmainat725b74bff.