Repository navigation
Conversation
Merging this PR will improve performance by ×2.2
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
charliermarsh
added a commit
to astral-sh/uv
that referenced
this pull request
Oct 18, 2026
…22676) We store each marker node once and keep only its hash and ID in the uniqueness index. We also normalize conjunction cache keys so `A AND B` and `B AND A` share an entry; disjunction uses the same cache. Compared with #22675 on an AMD EPYC devbox, full MTEB frozen export was 15.0% faster and peak RSS fell from 299 MiB to 191 MiB. Repeated string-atom parsing was 8.8% slower, and restricting extras across 12 shared pairs was 16.3% slower. [Measurements](https://gist.github.com/charliermarsh/a26d9abfeb794f4de0ad0f27cdfb2a66). [CodSpeed](#22676 (comment)) also reports about 5.9% higher simulated cost for a sparse DNF case; the cause remains unresolved. Ports [uv-dev#2167](astral-sh#2167).
This branch has not been 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.
The marker interner duplicates every node and its outgoing ranges in the uniqueness map, and its conjunction cache stores both operand orders separately. Keep immutable nodes in the shared store, index their IDs with cached hashes, and normalize conjunction-cache keys. This combines the indexing, cached-hash, and commutative-cache experiments in #2072, #2074, and #2081 on the marker performance stack. Hash-table entries retain an extra hash, but growing the index no longer rehashes large nodes or stores a second copy of their ranges.
Hyperfine 2.0.0 measurements of 021c6c422 → 6ed6756fe 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.Commands use frozen
uv workspace metadataanduv export, with the workspace-metadata preview enabled for metadata commands. Synthetic frozen script locks contain one root and conditional leaves. Repeated and distinct expressions, categorical and exclusion markers, same- and reverse-order operand pairs, and export or TOML fallback variants cover fresh interning and conjunction caches. Each command starts a fresh process and rebuilds its in-memory marker caches. OS pages and interpreter-query caches are warm. Frozen commands do not resolve, download, build, or install packages.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.
The seven distinct-marker or operand-pair workloads reduced runtime by 21.20% to 40.14% and peak RSS by 22.37% to 39.45%. The 32,768-edge case used about 88.21 MiB less peak RSS. Both shared-marker runtime controls are inconclusive; the 8,192-edge shared-marker control increased RSS by 0.59% (about 0.30 MiB). These effects apply to the combined indexing, cached-hash, and conjunction-cache changes; they do not establish a general resolver speedup. RSS is Hyperfine's Linux
wait4peak, not an allocation count or summed simultaneous process-tree memory.Earlier measurements
Earlier benchmark study:
Matched
021c6c422b→6ed6756fe1builds on an x86-64 Linux devbox changed the 78 MB MTEB frozen export from 673.7 ms to 506.8 ms: 24.8% faster (95% CI 24.0–25.3% faster). The general TOML fallback was 20.2% faster (95% CI 19.2–20.9% faster). Each workload used 21 alternating pairs, with paired-bootstrap intervals and compiler activity excluded at pair boundaries. Mean peak RSS on MTEB was 320.8 MiB → 243.3 MiB, 24.1% lower (95% CI 23.9–24.4% lower).Ordinary 5.5 kB
built-by-uvlock: 0.2% slower (inconclusive; 95% CI 1.2% slower to 0.9% faster); ordinary 165 kBscripts/benchmarklock: 3.4% faster (95% CI 2.3–4.5% faster); generated four-extra lock: 0.9% slower (inconclusive; 95% CI 2.1% slower to 0.3% faster); generated 30-extra lock: 7.6% faster (95% CI 6.7–8.6% faster); already-compact 70-extra lock: 1.2% slower (inconclusive; 95% CI 3.9% slower to 1.0% faster).