Repository navigation
Conversation
Merging this PR will improve performance by ×6.1
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | resolve_activated_extras[32] |
19,679.5 µs | 85.5 µs | ×230 |
| ⚡ | Simulation | resolve_activated_extras[32] |
84.4 ms | 1.2 ms | ×71 |
| ⚡ | WallTime | resolve_activated_extras[16] |
1,077.2 µs | 22.7 µs | ×47 |
| ⚡ | WallTime | unzip_wheel_many_files |
377.3 ms | 12.3 ms | ×31 |
| ⚡ | WallTime | install_wheel_many_files |
384.4 ms | 13.9 ms | ×28 |
| ⚡ | WallTime | prepare_wheel_many_files |
390.3 ms | 14.9 ms | ×26 |
| ⚡ | Simulation | resolve_activated_extras[16] |
4,260.7 µs | 347.3 µs | ×12 |
| ⚡ | WallTime | unpack_sdist_many_files |
316.1 ms | 36.6 ms | ×8.6 |
| ⚡ | WallTime | resolve_activated_extras[4] |
27.9 µs | 3.6 µs | ×7.7 |
| ⚡ | WallTime | resolve_warm_jupyter_universal |
87.6 ms | 11.9 ms | ×7.4 |
| ⚡ | WallTime | resolve_warm_jupyter |
16.7 ms | 2.5 ms | ×6.7 |
| ⚡ | WallTime | discover_workspace_from_all_members_with_excludes |
53.4 ms | 8.2 ms | ×6.5 |
| ⚡ | WallTime | discover_workspace_from_all_members |
50.5 ms | 7.9 ms | ×6.4 |
| ⚡ | WallTime | run_python_version_synthetic_workspace |
269.3 ms | 42.8 ms | ×6.3 |
| ⚡ | WallTime | imbibe_and_format[4] |
19.1 µs | 3.3 µs | ×5.8 |
| ⚡ | WallTime | resolve_warm_airflow |
234.3 ms | 42.3 ms | ×5.5 |
| ⚡ | WallTime | imbibe_and_format[32] |
18.4 ms | 3.4 ms | ×5.4 |
| ⚡ | WallTime | imbibe_and_format[16] |
888.3 µs | 163.8 µs | ×5.4 |
| ⚡ | WallTime | hash_sha256 |
1,165.7 µs | 406.5 µs | ×2.9 |
| ⚡ | Simulation | from_hex/lowercase[64] |
438.5 µs | 269.6 µs | +62.65% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing zb/resolve-activated-extras-in-bdd (3b3a7b5) with zb/bench-universal-conflict-markers (7c5b215)2
Footnotes
-
47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
zb/bench-universal-conflict-markers(fa69b46) during the generation of this report, so 7163639 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
| marker.visit_extras(|_, extra| { | ||
| if !extras.is_empty() { | ||
| extras.insert(extra.clone()); |
There was a problem hiding this comment.
[P2] Traverse shared BDD nodes only once
MarkerTree::visit_extras follows both branches recursively without remembering visited nodes; the set here only deduplicates the resulting names. For a conjunction of n independent two-extra disjunctions, with names ordered pair by pair, it invokes this callback 2^(n+1)-2 times despite only 2n distinct decision nodes. Large compact markers therefore still incur exponential work before reaching the new BDD path. Use node-memoized extra collection, and cache the restrictions used below (restrict_by also revisits shared subgraphs). Add this shared-subgraph shape to the benchmark coverage.
| // Substitute extras in BDD variable order. Restricting a later variable before an earlier one | ||
| // can leave adjacent version/string ranges pointing at the same child, which is semantically | ||
| // equivalent but not canonical and can prevent downstream reachability from converging. |
There was a problem hiding this comment.
[P3] Update the sorting rationale after fixing range coalescing
The new Edges::map_ranges coalesces adjacent ranges after restriction, and simplify_extras_preserves_canonical_ranges explicitly asserts canonical results for both substitution orders. This comment nevertheless describes ordering as necessary for canonicality and reachability convergence, obscuring the invariant now enforced by the algebra layer. Retain sorting if deterministic ordering is useful, but describe that purpose and remove the obsolete correctness claim.
Exporting existing lockfiles with many conflicting extras expands their markers into DNF before substituting activation conditions, making
uv exportslow even after locking has completed. Substitute those conditions directly in the decision diagram for markers with more than eight extras, and coalesce adjacent ranges so equivalent markers remain canonical during reachability analysis.Hyperfine 2.0.0 measurements of fa69b46dd → 1f7c651fd 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 include
uv export --frozen. Synthetic conflict workspaces use frozen parent-generated locks with 4 to 50 mutually exclusive extras, conditional or constant activation, and wider graphs; a no-conflict case is included. Within the supported Python range>=3.12,<3.14, conditional cases declareextra-000below Python 3.13 andextra-001from Python 3.13; constant activation selectsextra-000. The eight- and nine-extra conflict cases contain up to eight and nine distinct extras in an input marker, bracketing the targeted representation threshold. Each command starts a fresh process; OS pages, local wheel metadata, and interpreter-query caches are warm. Frozen exports read the same parent-generated locks. No external index, source backend, or package installation is used.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 30- and 50-extra conditional cases ran 50.64% and 82.04% faster; the 50-extra constant case ran 35.62% faster. The wider 16-extra conflict case ran 40.57% faster with 3.68% higher RSS. Runtime intervals for the single-name four-, eight-, nine-, and 16-extra cases include zero; RSS rose in the nine- and 16-extra cases and fell in the four- and eight-extra cases. The no-conflict control ran 1.86% faster and used 0.87% less RSS, although its input markers contained at most one extra. The full source pair includes changes to extra visitation and range canonicalization, so these measurements do not isolate substitution. RSS is Hyperfine's Linux
wait4peak, not an allocation count or summed simultaneous process-tree memory.