Visitar URL original
Reuse the owned `Upgrade` constraint map by zaniebot · Pull Request #1297 · astral-sh/uv-dev · GitHub
Skip to content

Reuse the owned Upgrade constraint map - #1297

Draft
zaniebot wants to merge 1 commit into
mainfrom
zb/reuse-owned-upgrade-constraints
Draft

zaniebot wants to merge 1 commit into
mainfrom
zb/reuse-owned-upgrade-constraints

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Upgrade::combine consumes both inputs but clones the higher-precedence constraint map before merging it. Move the owned map instead, retaining the upgrade-strategy precedence and constraint ordering established by astral-sh#18226 and astral-sh#19955.

Hyperfine 2.0.0 measurements of c4be69153 → 18379c72b 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 supplied interpreter was CPython 3.12.13.

uv pip compile reads --config-file, --upgrade-package and local --find-links wheels, with the selected --resolution mode. Complete uv pip compile commands combine synthetic command-line upgrade constraints with constraints in an explicit uv.toml, then resolve local wheels. Cases vary 0 to 2,048 keys per source, one or 128 resolved packages, and highest or lowest resolution. Most paired maps use matching keys; the mostly disjoint case shares one key and has 2,047 unique keys on each side. Two controls leave one map empty.

Local wheels provide versions 1.0.0, 2.0.0 and 3.0.0; matching >=2 and <3 constraints select 2.0.0. The complete commands include parsing, settings combination, resolution and formatting, so they do not isolate the map merge. Per-revision uv caches persist and local wheel metadata and OS pages are warm. The commands use local wheels without network access, source builds or installation.

Values are means, parent → head. Changes are (head / parent - 1) with 95% confidence intervals; negative values indicate a reduction.

Workload Wall time Change, 95% CI Peak RSS Change, 95% CI
1 CLI key / 1 config key / 1 package / overlap / highest 63.2 → 63.9 ms +1.10% [-0.12%, +2.34%] 34.33 → 34.41 MiB +0.22% [-0.07%, +0.49%]
16 CLI keys / 16 config keys / 1 package / overlap / highest 63.7 → 63.8 ms +0.05% [-1.58%, +1.13%] 34.65 → 34.69 MiB +0.12% [-0.24%, +0.51%]
128 CLI keys / 128 config keys / 1 package / overlap / highest 65.0 → 65.6 ms +0.96% [-0.46%, +2.73%] 35.53 → 35.35 MiB -0.52% [-0.77%, -0.31%]
512 CLI keys / 512 config keys / 1 package / overlap / highest 70.0 → 70.7 ms +1.04% [+0.21%, +1.82%] 38.22 → 38.08 MiB -0.35% [-0.61%, -0.11%]
2,048 CLI keys / 2,048 config keys / 1 package / overlap / highest 91.5 → 91.0 ms -0.55% [-1.26%, +0.21%] 50.98 → 50.09 MiB -1.73% [-2.04%, -1.37%]
2,048 CLI / 2,048 config keys / 1 shared / 1 package / highest 94.4 → 98.7 ms +4.49% [+3.57%, +5.38%] 54.28 → 57.64 MiB +6.19% [+5.65%, +6.72%]
0 CLI / 2,048 config keys / 1 package / highest 77.8 → 78.5 ms +0.84% [-0.05%, +1.65%] 46.08 → 46.07 MiB -0.02% [-0.31%, +0.31%]
2,048 CLI / 0 config keys / 1 package / highest 82.9 → 83.7 ms +0.97% [-0.02%, +1.85%] 47.25 → 47.39 MiB +0.30% [-0.18%, +0.78%]
128 CLI keys / 128 config keys / 128 packages / overlap / highest 130.3 → 135.5 ms +4.02% [+0.65%, +7.89%] 47.18 → 48.17 MiB +2.10% [+0.19%, +4.44%]
128 CLI keys / 128 config keys / 128 packages / overlap / lowest 133.3 → 126.5 ms -5.09% [-10.37%, +0.07%] 48.12 → 46.52 MiB -3.32% [-6.82%, -0.05%]

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 cases were slower: 512 matching keys and one package (+1.04%), the mostly disjoint 2,048-key maps (+4.49%), and the 128-package highest-resolution case (+4.02%). The other seven runtime intervals include zero. Peak RSS rose by 3.36 MiB and 0.99 MiB in the latter two cases and fell in four others by 0.13–1.60 MiB; the remaining four intervals include zero. These complete-command results do not isolate the map merge. RSS is Hyperfine's Linux wait4 peak, not an allocation count or summed simultaneous process-tree memory.

@astral-automations-bot astral-automations-bot Bot added internal A refactor or improvement that is not user-facing performance labels Sep 10, 2026
@zaniebot zaniebot added priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. size:0 Mechanical: little semantic reasoning; correctness is apparent from inspection or compiler checks. risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. labels Sep 10, 2026
@zaniebot zaniebot added the project:maintainer-followups Maintainer follow-up work label Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing 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:0 Mechanical: little semantic reasoning; correctness is apparent from inspection or compiler checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants