uv/crates
Charlie Marsh c3d809d276
Migrate to zlib-rs (again) (#11894)
## 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.
2025-03-03 17:29:31 +00:00
..
uv Migrate to zlib-rs (again) (#11894) 2025-03-03 17:29:31 +00:00
uv-auth Migrate from urlencoding to percent-encoding (#11144) 2025-01-31 16:29:46 -05:00
uv-bench Remove warnings for missing lower bounds (#11195) 2025-02-03 16:03:31 -06:00
uv-build-backend Remove unused thiserror variants (#11713) 2025-02-22 12:12:22 -10:00
uv-build-frontend Remove unused thiserror variants (#11713) 2025-02-22 12:12:22 -10:00
uv-cache Avoid silently dropping errors in directory enumeration (#11890) 2025-03-03 02:39:17 +00:00
uv-cache-info Fix git-tag cache-key reader in case of slashes (#10467) (#10500) 2025-01-11 21:30:46 -05:00
uv-cache-key Use hash instead of full wheel name in wheels bucket (#11738) 2025-02-26 22:41:57 +00:00
uv-cli Upgrade Rust toolchain to 1.85 (#11720) 2025-02-23 16:52:34 +01:00
uv-client Use hash instead of full wheel name in wheels bucket (#11738) 2025-02-26 22:41:57 +00:00
uv-configuration Replace outdated DevGroups* naming (#11921) 2025-03-03 16:39:44 +01:00
uv-console explicitly handle ctrl-c in confirmation prompt instead of signal handler (#11897) 2025-03-03 10:30:48 -05:00
uv-dev Migrate to zlib-rs (again) (#11894) 2025-03-03 17:29:31 +00:00
uv-dirs Eliminate dependencies on directores and dirs-sys (#8048) 2024-11-07 14:29:54 -06:00
uv-dispatch Add uv sync --dry-run (#11299) 2025-02-06 23:52:49 +00:00
uv-distribution Avoid silently dropping errors in directory enumeration (#11890) 2025-03-03 02:39:17 +00:00
uv-distribution-filename Fix version string truncation while generating cache_key (#11830) 2025-02-27 08:48:43 -05:00
uv-distribution-types Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-extract Use SmallString on Hashes (#11756) 2025-02-24 10:32:00 -10:00
uv-fs Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-git Move GIT_TERMINAL_PROMPT to env vars (#11789) 2025-02-26 03:56:24 +00:00
uv-git-types Avoid using owned String in deserializers (#11764) 2025-02-25 14:28:16 +00:00
uv-globfilter Build backend: Revamp include/exclude (#9525) 2024-12-01 11:32:35 +00:00
uv-install-wheel Remove unused thiserror variants (#11713) 2025-02-22 12:12:22 -10:00
uv-installer Use hash instead of full wheel name in wheels bucket (#11738) 2025-02-26 22:41:57 +00:00
uv-macros Remove unnecessary prefixes (#10158) 2024-12-25 14:18:01 -05:00
uv-metadata chore: Move all integration tests to a single binary (#8093) 2024-10-11 16:41:35 +02:00
uv-normalize Avoid using owned String in deserializers (#11764) 2025-02-25 14:28:16 +00:00
uv-once-map Use shared resolver state between add and lock (#8146) 2024-10-12 14:58:07 +00:00
uv-options-metadata Upgrade minimum Rust version to 1.83 (#9815) 2024-12-11 10:06:19 -06:00
uv-pep440 Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-pep508 Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-performance-memory-allocator Run cargo update (#10173) 2024-12-26 12:00:58 -05:00
uv-platform-tags Allow installation of manylinux wheels on loongarch64 (#10927) 2025-01-24 14:36:03 +01:00
uv-publish Use SmallString on Hashes (#11756) 2025-02-24 10:32:00 -10:00
uv-pypi-types Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-python Discover registry PEP 514 Pythons cross 32/64-bit (#11801) 2025-03-03 14:46:00 +00:00
uv-requirements Replace outdated DevGroups* naming (#11921) 2025-03-03 16:39:44 +01:00
uv-requirements-txt Skip unquote allocation for non-quoted strings (#11813) 2025-02-26 21:56:31 +00:00
uv-resolver Replace outdated DevGroups* naming (#11921) 2025-03-03 16:39:44 +01:00
uv-scripts Add tool.uv.build-constraint-dependencies to pyproject.toml (#11585) 2025-02-17 20:58:36 -05:00
uv-settings Fix reference to macOS cache path (#11845) 2025-02-28 02:14:09 +00:00
uv-shell Suggest uv tool update-shell in PowerShell (#11846) 2025-02-28 22:32:48 -05:00
uv-small-str Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-state Add uv-dirs to consolidate directory lookup methods (#8453) 2024-10-22 11:33:25 -05:00
uv-static rework log verbosity (-vvv) (#11758) 2025-02-28 18:49:27 -05:00
uv-tool Avoid string allocation when enumerating tool names (#11910) 2025-03-03 10:13:54 -05:00
uv-trampoline Upgrade Rust toolchain to 1.85 (#11720) 2025-02-23 16:52:34 +01:00
uv-trampoline-builder Upgrade Rust toolchain to 1.84.0 (#10533) 2025-01-11 22:19:33 -05:00
uv-types Use boxed slices for hash vector (#11714) 2025-02-24 11:11:44 -06:00
uv-version Bump version to 0.6.3 (#11759) 2025-02-24 17:25:01 -05:00
uv-virtualenv Update code page to 65001 before setting environment variables, fix #11828 (#11831) 2025-02-27 16:14:34 -05:00
uv-warnings chore: Move all integration tests to a single binary (#8093) 2024-10-11 16:41:35 +02:00
uv-workspace Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
README.md Link to Dependency specifiers instead of PEP 508 (#8411) 2024-10-21 14:43:38 -04:00

Crates

uv-bench

Functionality for benchmarking uv.

uv-cache-key

Generic functionality for caching paths, URLs, and other resources across platforms.

uv-distribution-filename

Parse built distribution (wheel) and source distribution (sdist) filenames to extract structured metadata.

uv-distribution-types

Abstractions for representing built distributions (wheels) and source distributions (sdists), and the sources from which they can be downloaded.

uv-install-wheel-rs

Install built distributions (wheels) into a virtual environment.

uv-once-map

A waitmap-like concurrent hash map for executing tasks exactly once.

uv-pep440-rs

Utilities for interacting with Python version numbers and specifiers.

uv-pep508-rs

Utilities for parsing and evaluating dependency specifiers, previously known as PEP 508.

uv-platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

uv-cli

Command-line interface for the uv package manager.

uv-build-frontend

A PEP 517-compatible build frontend for uv.

uv-cache

Functionality for caching Python packages and associated metadata.

uv-client

Client for interacting with PyPI-compatible HTTP APIs.

uv-dev

Development utilities for uv.

uv-dispatch

A centralized struct for resolving and building source distributions in isolated environments. Implements the traits defined in uv-types.

uv-distribution

Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc.

uv-extract

Utilities for extracting files from archives.

uv-fs

Utilities for interacting with the filesystem.

uv-git

Functionality for interacting with Git repositories.

uv-installer

Functionality for installing Python packages into a virtual environment.

uv-python

Functionality for detecting and leveraging the current Python interpreter.

uv-normalize

Normalize package and extra names as per Python specifications.

uv-requirements

Utilities for reading package requirements from pyproject.toml and requirements.txt files.

uv-resolver

Functionality for resolving Python packages and their dependencies.

uv-shell

Utilities for detecting and manipulating shell environments.

uv-types

Shared traits for uv, to avoid circular dependencies.

uv-pypi-types

General-purpose type definitions for types used in PyPI-compatible APIs.

uv-virtualenv

A venv replacement to create virtual environments in Rust.

uv-warnings

User-facing warnings for uv.

uv-workspace

Workspace abstractions for uv.

uv-requirements-txt

Functionality for parsing requirements.txt files.