1
1
# Benchmarks
2
2
3
- All benchmarks were computed on macOS using Python 3.12.0 (for non-uv tools), and come with a few
3
+ All benchmarks were computed on macOS using Python 3.12.4 (for non-uv tools), and come with a few
4
4
important caveats:
5
5
6
6
- Benchmark performance may vary dramatically across different operating systems and filesystems. In
@@ -9,11 +9,6 @@ important caveats:
9
9
- Benchmark performance may vary dramatically depending on the set of packages being installed. For
10
10
example, a resolution that requires building a single intensive source distribution may appear
11
11
very similar across tools, since the bottleneck is tool-agnostic.
12
- - Unlike Poetry, both uv and pip-tools do _ not_ generate platform-independent lockfiles. As such,
13
- Poetry is (by design) doing significantly more work than other tools in the resolution benchmarks.
14
- Poetry is included for completeness, as many projects may not _ need_ a platform-independent
15
- lockfile. However, it's critical to understand that benchmarking uv's resolution time against
16
- Poetry is an unfair comparison. (Benchmarking installation, however, _ is_ a fair comparison.)
17
12
18
13
This document benchmarks against Trio's ` docs-requirements.in ` , as a representative example of a
19
14
real-world project.
@@ -22,35 +17,35 @@ In each case, a smaller bar (i.e., lower) is better.
22
17
23
18
## Warm Installation
24
19
25
- Benchmarking package installation (e.g., ` uv pip sync ` ) with a warm cache. This is equivalent to
20
+ Benchmarking package installation (e.g., ` uv sync ` ) with a warm cache. This is equivalent to
26
21
removing and recreating a virtual environment, and then populating it with dependencies that you've
27
22
installed previously on the same machine.
28
23
29
- ![ install-warm] ( ./ assets/png/install-warm.png )
24
+ ![ install-warm] ( https://github.com/user-attachments/ assets/84118aaa-d030-4e29-8f1e-9483091ceca3 )
30
25
31
26
## Cold Installation
32
27
33
- Benchmarking package installation (e.g., ` uv pip sync ` ) with a cold cache. This is equivalent to
34
- running ` uv pip sync ` on a new machine or in CI (assuming that the package manager cache is not
35
- shared across runs).
28
+ Benchmarking package installation (e.g., ` uv sync ` ) with a cold cache. This is equivalent to running
29
+ ` uv sync ` on a new machine or in CI (assuming that the package manager cache is not shared across
30
+ runs).
36
31
37
- ![ install-cold] ( ./ assets/png/install-cold.png )
32
+ ![ install-cold] ( https://github.com/user-attachments/ assets/e7f5b203-7e84-452b-8c56-1ff6531c9898 )
38
33
39
34
## Warm Resolution
40
35
41
- Benchmarking dependency resolution (e.g., ` uv pip compile ` ) with a warm cache, but no existing
42
- lockfile. This is equivalent to blowing away an existing ` requirements.txt ` file to regenerate it
43
- from a ` requirements.in ` file.
36
+ Benchmarking dependency resolution (e.g., ` uv lock ` ) with a warm cache, but no existing lockfile.
37
+ This is equivalent to blowing away an existing ` requirements.txt ` file to regenerate it from a
38
+ ` requirements.in ` file.
44
39
45
- ![ resolve-warm] ( ./ assets/png/resolve-warm.png )
40
+ ![ resolve-warm] ( https://github.com/user-attachments/ assets/e1637a08-8b27-4077-8138-b3849e53eb04 )
46
41
47
42
## Cold Resolution
48
43
49
- Benchmarking dependency resolution (e.g., ` uv pip compile ` ) with a cold cache. This is equivalent to
50
- running ` uv pip compile ` on a new machine or in CI (assuming that the package manager cache is not
51
- shared across runs).
44
+ Benchmarking dependency resolution (e.g., ` uv lock ` ) with a cold cache. This is equivalent to
45
+ running ` uv lock ` on a new machine or in CI (assuming that the package manager cache is not shared
46
+ across runs).
52
47
53
- ![ resolve-cold] ( ./ assets/png/resolve-cold.png )
48
+ ![ resolve-cold] ( https://github.com/user-attachments/ assets/b578c264-c209-45ab-b4c3-54073d871e86 )
54
49
55
50
## Reproduction
56
51
@@ -69,7 +64,7 @@ To benchmark resolution against pip-compile, Poetry, and PDM:
69
64
70
65
``` shell
71
66
uv run resolver \
72
- --uv-pip \
67
+ --uv-project \
73
68
--poetry \
74
69
--pdm \
75
70
--pip-compile \
@@ -82,7 +77,7 @@ To benchmark installation against pip-sync, Poetry, and PDM:
82
77
83
78
``` shell
84
79
uv run resolver \
85
- --uv-pip \
80
+ --uv-project \
86
81
--poetry \
87
82
--pdm \
88
83
--pip-sync \
@@ -96,10 +91,10 @@ Both commands should be run from the `scripts/benchmark` directory.
96
91
After running the benchmark script, you can generate the corresponding graph via:
97
92
98
93
``` shell
99
- cargo run -p uv-dev render-benchmarks resolve-warm.json --title " Warm Resolution"
100
- cargo run -p uv-dev render-benchmarks resolve-cold.json --title " Cold Resolution"
101
- cargo run -p uv-dev render-benchmarks install-warm.json --title " Warm Installation"
102
- cargo run -p uv-dev render-benchmarks install-cold.json --title " Cold Installation"
94
+ cargo run -p uv-dev --all-features render-benchmarks resolve-warm.json --title " Warm Resolution"
95
+ cargo run -p uv-dev --all-features render-benchmarks resolve-cold.json --title " Cold Resolution"
96
+ cargo run -p uv-dev --all-features render-benchmarks install-warm.json --title " Warm Installation"
97
+ cargo run -p uv-dev --all-features render-benchmarks install-cold.json --title " Cold Installation"
103
98
```
104
99
105
100
You need to install the [ Roboto Font] ( https://fonts.google.com/specimen/Roboto ) if the labels are
0 commit comments