news.volyx.in

How uv got so fast (nesbitt.io)

1290 points by zdw · 209 days ago · 459 comments on HN

Article summary

The article discusses the design decisions that made uv, a Python package installer, faster than pip by an order of magnitude. The key factors include the adoption of modern standards such as PEP 518, 517, 621, and 658, which enable fast package installation without executing arbitrary code. Additionally, uv's design drops legacy support for certain features, such as .egg files and pip.conf, and optimizes package resolution and caching. These changes, combined with Rust's performance benefits, contribute to uv's speed advantage.

Main themes

  • Package installation performance
  • Python packaging standards
  • Rust vs Python
  • Legacy code support
  • Package resolution and caching

What commenters say

  • Skipping bytecode compilation by default in uv may introduce a one-time performance hit at startup time, but it can be mitigated by compiling bytecode at install time or using environment variables.
  • The decision to skip bytecode compilation by default in uv is a trade-off between installation time and startup time, and it may not be suitable for all use cases, such as serverless Python environments.
  • The adoption of modern packaging standards, such as pyproject.toml, has improved the performance and security of package installation, and tools like uv can take advantage of these improvements.
  • Rust's performance benefits are not the primary reason for uv's speed advantage, but rather the result of careful design decisions and the adoption of modern packaging standards.
  • Some commenters argue that uv's approach to package installation is not necessarily better than pip's, and that the performance benefits may not be significant in all use cases.
  • The use of pyproject.toml and other modern packaging standards has made it easier to migrate to uv and improve package installation performance, but some packages still lag behind in adopting these standards.