Skip to content

Reuse the resolver node index for deduplication - #1859

Draft
zaniebot wants to merge 1 commit into
mainfrom
zb/reuse-resolver-node-index
Draft

zaniebot wants to merge 1 commit into
mainfrom
zb/reuse-resolver-node-index

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Resolution graph construction maintains a separate seen set even though the inverse node index uses the same package and version identity. Use the existing index to detect nodes already added, removing the duplicate hash table while retaining first-fork selection and edge deduplication.

Measurements of an earlier pinned revision. Hyperfine 2.0.0 measurements of cc6880fd2 → 52242184f 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. The PR head at report preparation was bf16a9487; the measured head was 52242184f.

uv pip compile and uv lock use --offline, --no-index and local --find-links wheels; the retained-extra case uses --no-strip-extras. Complete uv pip compile commands resolve synthetic local wheels with 1 to 2,048 independent requirements or 128 to 2,048 leaves under one hub. Two 512-leaf hub cases request four extras, with extra names either stripped or retained in output. The leaf count excludes the hub.

Fresh uv lock controls use 8 or 32 sys_platform conditions, distinct selector versions and 32 or 128 shared leaves. The conditions include synthetic platform names. Leaf counts exclude the selector and project root. These whole commands include input parsing, metadata lookup, resolution, graph construction and output. Locks are removed outside measurement. Per-revision uv caches persist, and local wheel metadata, interpreter queries and OS pages are warm. Inputs are local; no network, source build or installation is used.

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
compile / 1 independent requirement 21.0 → 20.8 ms -1.05% [-3.10%, +1.23%] 32.93 → 32.85 MiB -0.25% [-0.73%, +0.23%]
compile / 16 independent requirements 26.5 → 26.6 ms +0.39% [-1.52%, +2.63%] 35.21 → 35.37 MiB +0.45% [-0.31%, +1.19%]
compile / 128 independent requirements 49.0 → 49.3 ms +0.56% [-1.69%, +3.31%] 42.68 → 42.91 MiB +0.53% [-0.41%, +1.67%]
compile / 512 independent requirements 102.5 → 102.8 ms +0.34% [-4.10%, +4.42%] 63.99 → 64.46 MiB +0.73% [-2.15%, +3.74%]
compile / 2,048 independent requirements 249.3 → 247.0 ms -0.90% [-2.77%, +1.03%] 121.74 → 119.74 MiB -1.64% [-3.72%, +0.48%]
compile / 128 hub leaves 49.2 → 49.4 ms +0.40% [-2.22%, +3.45%] 42.78 → 42.83 MiB +0.12% [-0.83%, +1.17%]
compile / 512 hub leaves 103.4 → 104.5 ms +1.04% [-3.61%, +5.56%] 64.72 → 65.02 MiB +0.48% [-2.54%, +3.23%]
compile / 2,048 hub leaves 249.2 → 250.6 ms +0.58% [-2.81%, +4.43%] 121.84 → 120.79 MiB -0.86% [-3.84%, +2.47%]
compile / 512 hub leaves / 4 extras / stripped 121.3 → 121.0 ms -0.21% [-3.51%, +2.69%] 75.78 → 75.89 MiB +0.14% [-1.83%, +1.89%]
compile / 512 hub leaves / 4 extras / retained 121.3 → 121.2 ms -0.12% [-3.81%, +3.82%] 75.32 → 75.86 MiB +0.71% [-1.75%, +3.40%]
lock / 8 platform conditions / 32 shared leaves 45.0 → 44.0 ms -2.26% [-4.07%, -0.57%] 41.93 → 41.98 MiB +0.10% [-0.45%, +0.58%]
lock / 32 platform conditions / 128 shared leaves 223.5 → 220.7 ms -1.23% [-3.29%, +1.08%] 77.58 → 77.28 MiB -0.40% [-1.75%, +1.02%]

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.

The lock workload with eight platform conditions and 32 shared leaves took 2.26% less time, with a 95% interval of -4.07% to -0.57%. The other 11 runtime intervals and all 12 peak RSS intervals include zero, so their results are inconclusive. These whole-command measurements do not isolate node-index lookup. RSS is Hyperfine's Linux wait4 peak, not an allocation count or summed simultaneous process-tree memory.

@codspeed

codspeed Bot commented Sep 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 25 untouched benchmarks


Comparing zb/reuse-resolver-node-index (5224218) with main (6b40d9e)

Open in CodSpeed

@zaniebot zaniebot added risk:0 No meaningful change to product, state, release, or automation behavior. 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
@zaniebot zaniebot added the project:maintainer-followups Maintainer follow-up work label Oct 9, 2026

This branch was successfully deployed

1 active deployment
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:0 No meaningful change to product, state, release, or automation behavior. 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.

2 participants