How uv got so fast
Python bytecode and startup vs install time
- uv skips
.pyccompilation on install; Python compiles on first import instead. - People note this shifts a one-time cost from install to first run: good for interactive/dev use, bad for environments where images are started many times (Docker, serverless).
- Several comments recommend enabling
UV_COMPILE_BYTECODEor equivalent flags when baking containers to avoid cold-start penalties; for large projects the first-import compilation can be hundreds of milliseconds. - Historical justification for install-time
.pyc: system-wide installs where the runtime user can’t write bytecode files.
Standards and ecosystem preconditions
- uv’s design leans heavily on modern packaging PEPs (517/518/621/658, wheels, manylinux).
- Moving away from
setup.pytopyproject.tomland static metadata removed the need to execute arbitrary code to discover dependencies, especially build-time ones. - Adoption has been slow and uneven; some major projects still have incomplete or problematic
pyproject.tomlsetups.
Rust vs architecture
- Many argue uv’s speed mostly comes from design: metadata-only resolution, aggressive wheel-first strategy, HTTP range requests for wheel metadata, global cache, parallel downloads, skipping old formats (
.egg), stricter parsing, and not supporting legacy config paths. - Rust still matters for: single self-contained binary (no Python bootstrap), cheap real threads, zero-copy deserialization via
rkyv, and much lower interpreter-startup overhead. - Debate over “Rust-specific” claims: zero-copy is a systems-language technique generally; what’s hard is doing it in Python without copies and lifetime bugs.
pip, legacy, and greenfield constraints
- pip is seen as hard to modernize: large, old codebase, HTTP-style cache, huge import tree (hundreds of modules, including heavy dependencies like Rich), and deep backward-compat commitments.
- Some pip feature requests (e.g., robust cross-platform resolution) reportedly clash with its current architecture.
- Several comments frame uv’s success as what you get when you start fresh on modern standards, not as a pure “Rust rewrite.”
Version constraints and Python 4
- uv is described as ignoring upper
requires-pythonbounds like<4.0, on the theory they’re defensive guesses, not known incompatibilities, and they massively increase resolver backtracking. - Some worry this is risky given real breakage between minor 3.x releases; others argue that honoring speculative upper bounds propagates needless constraints through the dependency tree.
Where speed matters
- Biggest wins reported in CI, Docker builds, and large monoliths: installs dropping from minutes to seconds, substantial pipeline time savings.
- Speed also changes workflows: people are more willing to spin up fresh envs or use
uv run/uvxad hoc.
Tooling and security notes
- uv is contrasted with pipenv, poetry, conda, etc.; many see uv as finally making Python “pleasant” for everyday scripting and cross-platform utilities.
- Some caution that
uvx’s convenience increases exposure to typo-squatting; it’s no worse thanpip installbut now happens more often.
Reactions to the article
- Multiple commenters like the technical content but strongly dislike the perceived LLM-edited style: repetitive “it’s X, not Y” constructions, marketing tone, and lack of clear weighting of which optimizations matter most.
- There’s broader worry about AI-shaped prose becoming the default in technical writing, and calls for clearer disclosure when LLMs are used.