-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolution stress test (>10 seconds offline with warm cache) #10438
Comments
Thank you the perfect reproducer! From the profile this is the same underlying problem as #10430: It's 87% in uv/crates/uv-resolver/src/candidate_selector.rs Lines 181 to 188 in 0d57d29
Crudely patching that out and applying [https://github.com//pull/10439], the bottleneck is still the same code snippet from above: |
That's good news since this is CPU work which we can always improve :) |
Motivated by #10438. Ideally we wouldn't be calling this code that much in the first place, but it's the more idiomatic way to write this code. Crude-ish benchmark based on #10438 with the `without_markers` patched out: ``` hyperfine --warmup 1 "./uv-1 pip compile scripts/requirements/airflow2-req.in -c scripts/requirements/airflow2-constraints.txt --universal --python-version 3.8" "./uv-2 pip compile scripts/requirements/airflow2-req.in -c scripts/requirements/airflow2-constraints.txt --universal --python-version 3.8" Benchmark 1: ./uv-1 pip compile scripts/requirements/airflow2-req.in -c scripts/requirements/airflow2-constraints.txt --universal --python-version 3.8 Time (mean ± σ): 1.229 s ± 0.018 s [User: 1.206 s, System: 0.111 s] Range (min … max): 1.211 s … 1.269 s 10 runs Benchmark 2: ./uv-2 pip compile scripts/requirements/airflow2-req.in -c scripts/requirements/airflow2-constraints.txt --universal --python-version 3.8 Time (mean ± σ): 873.8 ms ± 5.1 ms [User: 851.2 ms, System: 112.5 ms] Range (min … max): 865.2 ms … 880.4 ms 10 runs Summary ./uv-2 pip compile scripts/requirements/airflow2-req.in -c scripts/requirements/airflow2-constraints.txt --universal --python-version 3.8 ran 1.41 ± 0.02 times faster than ./uv-1 pip compile scripts/requirements/airflow2-req.in -c scripts/requirements/airflow2-constraints.txt --universal --python-version 3.8 ```
First, I don't use these requirements anymore, they are based on requirements I used to use ~6 months ago, so this is not a priority for me, but I do use these as a smoke test for uv. These are reduced from the real requirements, which were built to match the Airflow dockerfile, the Python 3.10 Airflow constraints file, and other production and development requirements.
Secondly, there is a big performance difference between my work environment and my home environment I haven't been able to explain, in my home environment I am only able to produce slow performance with fork strategy Requires-Python and python version 3.8, but in my work environment I am able to produce slow performance with both fork strategies and python version 3.10, and in my work environment I see a 20+% slow down between 0.5.15 and 0.5.16 but in my home environment I see almost no difference. I am trying to identify anything other than hardware that might be the difference.
See requirements.in and constraints.txt:
requirements.in
constraints.txt
Run Tests:
uv pip compile requirements.in -c constraints.txt --universal --no-progress --python-version 3.8 > /dev/null
uv pip compile requirements.in -c constraints.txt --universal --no-progress --python-version 3.8 --offline > /dev/null
On my home machine the second command takes ~13 seconds, on my work machine this takes ~123 seconds.
The text was updated successfully, but these errors were encountered: