mirror of
https://github.com/astral-sh/uv
synced 2026-01-22 14:00:11 -05:00
## Summary I believe `zlib-rs` is now a better choice on ARM and x86, so I'm just going to assume it's a better choice everywhere. It's much easier to build (removes our CMake dependency), and in my benchmarking, it's substantially faster on ARM and faster or ~exactly even on my x86 Windows machine. We migrated to `zlib-rs` once before (#9184); however, I later reverted it as I learned that they were only doing compile-time feature detection, and so `zlib-rs` was meaningfully slower on x86. They now perform runtime feature detection: https://trifectatech.org/blog/zlib-rs-is-faster-than-c/. To benchmark, I wrote a script to create a local Simple API-compliant registry (see the commit history) for a single package. Then I ran the `install-cold` benchmark against that registry to install NumPy. On ARM: ``` ❯ uv run resolver --uv-pip-path ../../zlib-ng --uv-pip-path ../../zlib-rs \ --benchmark install-cold \ req.txt --warmup 10 --min-runs 30 Benchmark 1: ../../zlib-ng (install-cold) Time (mean ± σ): 165.7 ms ± 34.7 ms [User: 64.4 ms, System: 93.2 ms] Range (min … max): 141.8 ms … 293.2 ms 30 runs Benchmark 2: ../../zlib-rs (install-cold) Time (mean ± σ): 150.9 ms ± 16.2 ms [User: 57.4 ms, System: 86.4 ms] Range (min … max): 135.3 ms … 202.4 ms 30 runs Summary ../../zlib-rs (install-cold) ran 1.10 ± 0.26 times faster than ../../zlib-ng (install-cold) ``` I benchmarked this about 100 times on my Windows machine and found it difficult to conclude anything beyond "They're nearly the same". Here's an example: ``` PS C:\Users\crmar\workspace\puffin> hyperfine --prepare "uv venv" "zlib-rs.exe pip sync ./scripts/benchmark/req.txt" "zlib-ng.exe pip sync ./scripts/benchmark/req.txt" "zlib-rs.exe pip sync ./scripts/benchmark/req.txt" "zlib-ng.exe pip sync ./scripts/benchmark/req.txt" --runs 10 --warmup 5 Benchmark 1: zlib-rs.exe pip sync ./scripts/benchmark/req.txt Time (mean ± σ): 240.6 ms ± 10.8 ms [User: 6.1 ms, System: 92.2 ms] Range (min … max): 229.4 ms … 267.9 ms 10 runs Benchmark 2: zlib-ng.exe pip sync ./scripts/benchmark/req.txt Time (mean ± σ): 241.3 ms ± 6.2 ms [User: 7.7 ms, System: 90.6 ms] Range (min … max): 233.9 ms … 252.1 ms 10 runs Benchmark 3: zlib-rs.exe pip sync ./scripts/benchmark/req.txt Time (mean ± σ): 242.8 ms ± 7.7 ms [User: 6.2 ms, System: 23.4 ms] Range (min … max): 236.1 ms … 262.8 ms 10 runs Benchmark 4: zlib-ng.exe pip sync ./scripts/benchmark/req.txt Time (mean ± σ): 245.9 ms ± 5.7 ms [User: 1.5 ms, System: 59.4 ms] Range (min … max): 240.9 ms … 257.3 ms 10 runs Summary zlib-rs.exe pip sync ./scripts/benchmark/req.txt ran 1.00 ± 0.05 times faster than zlib-ng.exe pip sync ./scripts/benchmark/req.txt 1.01 ± 0.06 times faster than zlib-rs.exe pip sync ./scripts/benchmark/req.txt 1.02 ± 0.05 times faster than zlib-ng.exe pip sync ./scripts/benchmark/req.txt ``` Closes #11885.
81 lines
2.6 KiB
TOML
81 lines
2.6 KiB
TOML
[package]
|
|
name = "uv-dev"
|
|
version = "0.0.1"
|
|
description = "Build wheels from source distributions"
|
|
publish = false
|
|
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
homepage = { workspace = true }
|
|
documentation = { workspace = true }
|
|
repository = { workspace = true }
|
|
authors = { workspace = true }
|
|
license = { workspace = true }
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
uv-cache = { workspace = true, features = ["clap"] }
|
|
uv-cli = { workspace = true }
|
|
uv-client = { workspace = true }
|
|
uv-configuration = { workspace = true }
|
|
uv-distribution-filename = { workspace = true }
|
|
uv-distribution-types = { workspace = true }
|
|
uv-extract = { workspace = true, optional = true }
|
|
uv-installer = { workspace = true }
|
|
uv-macros = { workspace = true }
|
|
uv-options-metadata = { workspace = true }
|
|
uv-pep508 = { workspace = true }
|
|
uv-pypi-types = { workspace = true }
|
|
uv-python = { workspace = true }
|
|
uv-settings = { workspace = true, features = ["schemars"] }
|
|
uv-static = { workspace = true }
|
|
uv-workspace = { workspace = true, features = ["schemars"] }
|
|
|
|
# Any dependencies that are exclusively used in `uv-dev` should be listed as non-workspace
|
|
# dependencies, to ensure that we're forced to think twice before including them in other crates.
|
|
anstream = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
clap = { workspace = true, features = ["derive", "wrap_help"] }
|
|
fs-err = { workspace = true, features = ["tokio"] }
|
|
itertools = { workspace = true }
|
|
markdown = { version = "0.3.0" }
|
|
owo-colors = { workspace = true }
|
|
poloto = { version = "19.1.2", optional = true }
|
|
pretty_assertions = { version = "1.4.1" }
|
|
resvg = { version = "0.29.0", optional = true }
|
|
schemars = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
tagu = { version = "0.1.6", optional = true }
|
|
textwrap = { workspace = true }
|
|
tokio = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-durations-export = { workspace = true, features = ["plot"] }
|
|
tracing-subscriber = { workspace = true }
|
|
uv-performance-memory-allocator = { path = "../uv-performance-memory-allocator", optional = true }
|
|
walkdir = { workspace = true }
|
|
|
|
[lib]
|
|
name = "uv_dev"
|
|
|
|
[[bin]]
|
|
name = "uv-dev"
|
|
# We don't want to build the dev CLI by default, so we skip it by requiring an off-by-default feature
|
|
required-features = ["dev"]
|
|
|
|
[features]
|
|
default = ["performance"]
|
|
# Actually build the dev CLI.
|
|
dev = []
|
|
performance = [
|
|
"performance-memory-allocator",
|
|
"uv-extract/performance"
|
|
]
|
|
performance-memory-allocator = ["dep:uv-performance-memory-allocator"]
|
|
render = ["poloto", "resvg", "tagu"]
|
|
|
|
[package.metadata.cargo-shear]
|
|
ignored = ["flate2", "uv-extract", "uv-performance-memory-allocator"]
|