Repository navigation
Conversation
813465e to
e28a809
Compare
e28a809 to
1ce6234
Compare
Merging this PR will not alter performance
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| 🆕 | Simulation | indexed[asymmetric-16x4096] |
N/A | 10.7 ms | N/A |
| 🆕 | Simulation | indexed[asymmetric-4096x16] |
N/A | 2.4 ms | N/A |
| 🆕 | Simulation | indexed[asymmetric-4096x32] |
N/A | 4 ms | N/A |
| 🆕 | Simulation | indexed[asymmetric-4096x8] |
N/A | 1.6 ms | N/A |
| 🆕 | Simulation | indexed[asymmetric-8x4096] |
N/A | 11 ms | N/A |
| 🆕 | Simulation | indexed[hit-first-4096x4096] |
N/A | 9.2 ms | N/A |
| 🆕 | Simulation | indexed[hit-last-4096x4096] |
N/A | 8.1 ms | N/A |
| 🆕 | Simulation | indexed[miss-4096x4096] |
N/A | 7.9 ms | N/A |
| 🆕 | Simulation | indexed[mixed-1024x1024] |
N/A | 3.8 ms | N/A |
| 🆕 | Simulation | indexed[mixed-128x128] |
N/A | 434.1 µs | N/A |
| 🆕 | Simulation | indexed[mixed-16x16] |
N/A | 43.3 µs | N/A |
| 🆕 | Simulation | indexed[mixed-32x32] |
N/A | 89.8 µs | N/A |
| 🆕 | Simulation | indexed[mixed-4096x4096] |
N/A | 12.3 ms | N/A |
| 🆕 | Simulation | indexed[mixed-512x512] |
N/A | 1.8 ms | N/A |
| 🆕 | Simulation | indexed[mixed-64x64] |
N/A | 149.1 µs | N/A |
| 🆕 | Simulation | indexed[mixed-8x8] |
N/A | 22.3 µs | N/A |
| 🆕 | Simulation | linear[asymmetric-16x4096] |
N/A | 12.4 ms | N/A |
| 🆕 | Simulation | linear[asymmetric-4096x16] |
N/A | 2.4 ms | N/A |
| 🆕 | Simulation | linear[asymmetric-4096x32] |
N/A | 3.9 ms | N/A |
| 🆕 | Simulation | linear[asymmetric-4096x8] |
N/A | 1.6 ms | N/A |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Comparing zb/bughuntperf/282-build-reinstall-partition (7c5f51b) with main (238d6ba)
Footnotes
-
35 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. ↩
1ce6234 to
27ec7d3
Compare
| let right_remote = remote; | ||
| let (left_reinstalls, right_reinstalls) = reinstalls | ||
| .into_iter() | ||
| .partition::<Vec<_>, _>(|dist| !right_remote.iter().any(|d| d.name() == dist.name())); |
There was a problem hiding this comment.
[P3] Compare equivalent partition operations
The linear baseline moves remote directly, while Plan::partition first runs remote.into_iter().partition(...). Consequently, the small and asymmetric cases compare different work even when should_index is false and both use the same membership scan. This confounds the comparison intended to justify the indexing thresholds. Include the same remote partition in the baseline, or compare the production benchmark across base and head.
| group.bench_function(BenchmarkId::new("linear", &input), |benchmark| { | ||
| benchmark.iter(|| partition_linear(black_box(plan(&remote, &reinstalls)))); | ||
| }); | ||
| group.bench_function(BenchmarkId::new("indexed", &input), |benchmark| { | ||
| benchmark.iter(|| black_box(plan(&remote, &reinstalls)).partition(|_| false)); |
There was a problem hiding this comment.
[P3] Move fixture cloning outside the timed loop
Both timed closures call plan, which clones every remote Arc and every InstalledDist, including its boxed installation path. Production partitioning consumes an existing plan without these clones. Including this additional linear work and result destruction dilutes the lookup cost, particularly for the small cases used to assess the cutoffs. Use iter_batched with plan(...) in the setup closure and return the partition result from the measured closure, following the existing benchmark patterns.
| //! Benchmarks for separating reinstalls between isolated and shared source-build phases. | ||
|
|
||
| use std::hint::black_box; |
There was a problem hiding this comment.
[P3] Use uv's allocator in the partition benchmark
This benchmark never references uv_performance_memory_allocator, so it uses the system allocator on targets where uv normally selects jemalloc or mimalloc. The optimization trades linear scans for an allocated FxHashSet, making allocator costs relevant to the small-plan indexing thresholds. Add extern crate uv_performance_memory_allocator;, following benches/uv.rs and workspace_discovery.rs, so the measurements reflect uv's allocator.
7c5f51b to
94c39b2
Compare
94c39b2 to
1314e29
Compare
Partitioning an install plan into isolated and shared-build phases scans the shared-phase remote distributions for every reinstall. Large plans can repeat the same name comparisons quadratically. Build a borrowed-name index when there are more than eight shared-phase remotes and more than 32 reinstalls, initializing it only when a lookup does not match the first remote. Smaller plans and repeated first-name matches keep the allocation-free scan.
Hyperfine 2.0.0 measurements of 1f85ea101 → 7c5f51bf6 used release builds with Rust 1.99.0 and CPython 3.12.13 on an AMD EPYC-Genoa Linux VM, pinned to four CPUs. The command was
uv pip install -r requirements.in --refresh --link-mode copy --no-index --find-links WHEELS --python VENV_PYTHON, with--no-config --color never --cache-dir CACHE. Output went to/dev/null.Each invocation replaces synthetic installed 0.9.0 distributions with valid local 1.0.0 wheels.
--no-build-isolation-packageis repeated for each name selecting the shared installation phase. Hyperfine's--preparerestores the complete old installed tree outside measured time and RSS. Explicit refresh exercises preparation and phase partitioning with populated caches. Whole-command time includes resolution, planning, partitioning, wheel preparation, removal, copying, and metadata writes. OS pages and cache contents were warm, with refresh enabled. No source backend is executed.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.
All eight runtime intervals include zero. The largest replacement plan changes from 3,164.3 ms to 3,166.0 ms, or +0.05% [-0.68%, +0.63%]. The 1,024-replacement, 512-shared-name case uses about 3.92 MiB less peak RSS: 117.08 MiB before and 113.16 MiB after, a reduction of 3.35% with a change interval of -5.63% to -1.18%. The other seven RSS intervals include zero. These complete replacement commands show a memory reduction in one indexed workload without an established runtime improvement. RSS is Hyperfine's Linux
wait4peak, not an allocation count or summed simultaneous process-tree memory.Existing component benchmarks
Add
Plan::partitionbenchmarks for small and large mixed plans, asymmetric remote/reinstall counts, and first-hit, last-hit, and missing-name cases. The linear comparison is a reduced copy of the previous membership loop.