17 Matching Annotations
  1. Last 7 days
    1. How uv got so fast
      • uv installs Python packages 10x faster than pip due to design decisions beyond just being written in Rust.
      • Key standards like PEP 518 (pyproject.toml), PEP 517, PEP 621, and PEP 658 enabled static metadata parsing without executing untrusted code.
      • uv drops legacy support: no .egg files, no pip.conf, no default bytecode compilation, requires virtual environments, stricter spec enforcement, ignores upper Python bounds, first-index wins.
      • Non-Rust optimizations include HTTP range requests for metadata, parallel downloads, global cache with hardlinks, Python-free resolution, and PubGrub resolver.
      • Rust-specific advantages: zero-copy deserialization, lock-free data structures, no interpreter startup, compact version representation.
      • Lesson: Speed comes from modern standards, dropping legacy features, and fresh assumptions rather than language alone.

      Hacker News Discussion

      • Users praise uv's speed and discuss its impact on Python workflows, with many switching from pip.
      • Debate on Rust's role: some credit architectural choices over language, others highlight zero-copy and concurrency benefits.
      • Questions about compatibility gaps like missing pip.conf and .egg support, but most see them as acceptable trade-offs.
      • Comparisons to Cargo and npm emphasize Python's late adoption of static metadata standards.
      • Interest in PubGrub resolver and potential for pip to adopt similar optimizations without Rust.
    2. Optimizations that don’t need Rust Some of uv’s speed comes from Rust. But not as much as you’d think. Several key optimizations could be implemented in pip today: HTTP range requests for metadata. Wheel files are zip archives, and zip archives put their file listing at the end. uv tries PEP 658 metadata first, falls back to HTTP range requests for the zip central directory, then full wheel download, then building from source. Each step is slower and riskier. The design makes the fast path cover 99% of cases. This is HTTP protocol work, not Rust. Parallel downloads. pip downloads packages one at a time. uv downloads many at once. This is concurrency, not language magic. Global cache with hardlinks. pip copies packages into each virtual environment. uv keeps one copy globally and uses hardlinks (or copy-on-write on filesystems that support it). Installing the same package into ten venvs takes the same disk space as one. This is filesystem ops, not language-dependent. Python-free resolution. pip needs Python running to do anything, and invokes build backends as subprocesses to get metadata from legacy packages. uv parses TOML and wheel metadata natively, only spawning Python when it hits a setup.py-only package that has no other option. PubGrub resolver. uv uses the PubGrub algorithm, originally from Dart’s pub package manager. pip uses a backtracking resolver. PubGrub is faster at finding solutions and better at explaining failures. It’s an algorithm choice, not a language choice

      Many of uv's optimisations come from improvements that can be made without rust such as http range requests for packages, parallel downloading, better local caching

    3. No .egg support. Eggs were the pre-wheel binary format. pip still handles them; uv doesn’t even try. The format has been obsolete for over a decade. No pip.conf. uv ignores pip’s configuration files entirely. No parsing, no environment variable lookups, no inheritance from system-wide and per-user locations. No bytecode compilation by default. pip compiles .py files to .pyc during installation. uv skips this step, shaving time off every install. You can opt in if you want it. Virtual environments required. pip lets you install into system Python by default. uv inverts this, refusing to touch system Python without explicit flags. This removes a whole category of permission checks and safety code. Stricter spec enforcement. pip accepts malformed packages that technically violate packaging specs. uv rejects them. Less tolerance means less fallback logic. Ignoring requires-python upper bounds. When a package says it requires python<4.0, uv ignores the upper bound and only checks the lower. This reduces resolver backtracking dramatically since upper bounds are almost always wrong. Packages declare python<4.0 because they haven’t tested on Python 4, not because they’ll actually break. The constraint is defensive, not predictive. First-index wins by default. When multiple package indexes are configured, pip checks all of them. uv picks from the first index that has the package, stopping there. This prevents dependency confusion attacks and avoids extra network requests. Each of these is a code path pip has to execute and uv doesn’t.

      UV does not support egg files or legacy pip.conf and it doesn't check for upper bounds on dependencies or compile py files to pyc bytecode by default. This removes a number of codepaths and allows the tool to run faster.

    4. PEP 658 went live on PyPI in May 2023. uv launched in February 2024. The timing isn’t coincidental. uv could be fast because the ecosystem finally had the infrastructure to support it. A tool like uv couldn’t have shipped in 2020. The standards weren’t there yet.

      Before February 2024 the pip standards for pyproject.toml and wheel management weren't there and UV would not have been possible.

      The relevant PEP standards are 517, 518, 621 and 658

  2. Mar 2025
  3. Jan 2025
  4. Nov 2024
    1. I’m writing this on October 15th, 2024. Last week I would’ve said you probably shouldn’t be using uv’s Python in production, because you wouldn’t be getting security updates to OpenSSL. This week, I would tentatively say that it’s fine. This makes me a little uncomfortable, because there may well be other issues I haven’t thought of, and uv is still very new.

      You may use uv in production, but there may be still some undiscovered quirks.

    2. The ability to install Python with uv adds interesting possibilities for production packaging. For example, you can use an Ubuntu 24.04 base Docker image, download uv, and rely on uv to trivially install any Python version. Which is to say, you won’t be limited to the versions Ubuntu packages for you.
  5. Jan 2022
    1. Despite lively discussion on the role that UV-based technologies can play in reducing SARS-CoV-2 transmission [[27], [28], [29], [30]], available data on its use and impact are still scant, setting-specific and heterogeneous in terms of study design and assessed outcomes

      Scientific data on UV & airborn diseases still lagging behind other precautionary methods.

  6. Sep 2020
    1. Researchers offer first proof that Ultraviolet C light with a 222 nm wavelength — which is safer to use around humans — effectively kills the SARS-CoV-2 virus.

      Take Away: Most germicidal ultraviolet (UV) lamps emit a wavelength of around 254 nm. While these are very effective means of sterilization, they are also damaging to human skin and eyes and therefore are used in unoccupied spaces. However, a recent study has shown that a safer form of UV light at a wavelength of 222 nm is effective in killing SARS-CoV-2 virus in vitro.

      The Claim: Researchers offer first proof that Ultraviolet C light with a 222 nm wavelength — which is safer to use around humans — effectively kills the SARS-CoV-2 virus.

      The Evidence: The authors reference the safety of 222 nm UV light, and there are many studies to support this claim. 222 nm UV light has been shown to not cause DNA damage or skin lesions even at higher doses and for longer exposure times than used here (1, 2).

      In the study referenced, researchers at Hiroshima University exposed SARS-CoV-2 virus to low dosage 222 nm UV light and subsequently measured the amount of viable virus (3). They found that exposure of 0.1 mW/cm^2 for 30 seconds reduced the amount of viable virus by 99.7%. However, as the authors note, this study was performed using virus plated on a dish in a hood, and translation of these results to a public setting is unclear. For instance, in a hospital, there are many different types of surfaces and direct/consistent exposure to the UV light might not be feasible. While this study is promising, additional studies need to be done before promoting this as a safe and effective means of killing SARS-CoV-2 in an occupied environment.

      Sources: 1) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6059456/

      2) https://onlinelibrary.wiley.com/doi/abs/10.1111/php.13269

      3) https://www.sciencedirect.com/science/article/pii/S0196655320308099#:~:text=Results,after%20a%205%2Dmin%20irradiation.