mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-17 05:47:45 +00:00
![]() Solving spent a chunk of its time just converting resolutions, the left two blocks:  These blocks are `ResolverOutput::from_state` with 1.3% and `ForkState::into_resolution` with 4.1% of resolver thread runtime for apache airflow universal. We reduce the overhead spent in those functions, to now 1.1% and 2.1% of resolver time spend in those functions by: Commit 1: Replace the hash set for the edges with a vec in `ForkState::into_resolution`. We deduplicate edges anyway when collecting them, and the hash-and-insert was slow. Commit 2: Reduce the distribution clonign in `ResolverOutput::from_state` by using an `Arc`. The same profile excerpt for the resolver with the branch (note that there is now an unrelated block between the two we optimized):  Wall times are noisy, but the profiles show those changes as improvements. ``` $ hyperfine --warmup 2 "./uv-main pip compile --no-progress scripts/requirements/airflow.in --universal" "./uv-branch pip compile --no-progress scripts/requirements/airflow.in --universal" Benchmark 1: ./uv-main pip compile --no-progress scripts/requirements/airflow.in --universal Time (mean ± σ): 99.1 ms ± 3.8 ms [User: 111.8 ms, System: 115.5 ms] Range (min … max): 93.6 ms … 110.4 ms 29 runs Benchmark 2: ./uv-branch pip compile --no-progress scripts/requirements/airflow.in --universal Time (mean ± σ): 97.1 ms ± 4.3 ms [User: 114.8 ms, System: 112.0 ms] Range (min … max): 90.9 ms … 112.4 ms 29 runs Summary ./uv-branch pip compile --no-progress scripts/requirements/airflow.in --universal ran 1.02 ± 0.06 times faster than ./uv-main pip compile --no-progress scripts/requirements/airflow.in --universal ``` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |