Top
Best
New

Posted by zdw 12/26/2025

How uv got so fast(nesbitt.io)
1290 points | 459 commentspage 4
Unissued2003 12/28/2025|
I think one thing that gets lost in the uv noise is that recent versions of pip are significantly faster. It would be much better to just make pip faster and add features to it instead of introducing a completely new package manager. Hopefully uv will do what yarn did to JavaScript - turbocharge some improvements in the core tooling through competitive pressure.
dangoodmanUT 12/27/2025||
> Zero-copy deserialization

Just a nit on this section: zero-copy deserialization is not Rust specific (see flatbuffers). rkyv as a crate for doing so in Rust is though

zahlman 12/26/2025||
I've talked about this many times on HN this year but got beaten to the punch on blogging it seems. Curses.

... Okay, after a brief look, there's still lots of room for me to comment. In particular:

> pip’s slowness isn’t a failure of implementation. For years, Python packaging required executing code to find out what a package needed.

This is largely refuted by the fact that pip is still slow, even when installing from wheels (and getting PEP 600 metadata for them). Pip is actually still slow even when doing nothing. (And when you create a venv and allow pip to be bootstrapped in it, that bootstrap process takes in the high 90s percent of the total time used.)

rao-v 12/27/2025||
I have to say it's just lovely seeing such a nicely crafted and written technical essay. It's so obvious that this is crafted by hand, and reading it just reemphasises how much we've lost because technical bloggers are too ready to hand the keys over to LLMs.
yakshaving_jgt 12/27/2025|
This post was very clearly written with an LLM.
vjay15 12/27/2025||
Amazing that how much python's pip was so bottlenecked, it was basic design problem damn
IshKebab 12/26/2025||
Mmm I don't buy it. Not many projects use setup.py now anyway and pip is still super slow.

> Plenty of tools are written in Rust without being notably fast.

This also hasn't been my experience. Most tools written in Rust are notably fast.

zahlman 12/26/2025||
> Not many projects use setup.py now anyway and pip is still super slow.

Yes, but that's still largely not because of being written in Python. The architecture is really just that bad. Any run of pip that touches the network will end up importing more than 500 modules and a lot of that code will simply not be used.

For example, one of the major dependencies is Rich, which includes things like a 3600-entry mapping of string names to emoji; Rich in turn depends on Pygments which normally includes a bunch of rules for syntax highlighting in dozens of programming languages (but this year they've finished trimming those parts of the vendored Pygments).

Another thing is that pip's cache is an HTTP cache. It literally doesn't know how to access its own package download cache without hitting the network, and it does that access through wrappers that rely on cachecontrol and Requests.

IshKebab 12/27/2025||
> Any run of pip that touches the network will end up importing more than 500 modules and a lot of that code will simply not be used.

That's a property of Python though. The fact that it isn't compiled (and that importing is very slow).

> a 3600-entry mapping of string names to emoji

Which can easily be zero-cost in Rust.

> It literally doesn't know how to access its own package download cache without hitting the network

This is the only example you've given that actually fits with your thesis.

zahlman 12/27/2025||
> That's a property of Python though. The fact that it isn't compiled (and that importing is very slow).

Bytecode compilation is compilation.

There are many things that could be used to improve import speed that I never even see discussed, let alone implemented.

But most importantly, pip doesn't need to have all these modules imported. They already proved they could defer the Requests imports; but the actual network calls aren't that hard to do with the standard library anyway. (As nice as it would be to have Requests in the standard library, but I digress.) Most of the stuff it imports up-front from Rich will go entirely unused.

> Which can easily be zero-cost in Rust.

Which is irrelevant to the point.

> This is the only example you've given that actually fits with your thesis.

No. My thesis is that pip doesn't have to be the way it is in order to actually solve the problem of installing Python packages. Everything I mentioned is an example of a thing pip doesn't have to do in order to install packages, and slows it down unnecessarily.

IshKebab 12/28/2025||
> Bytecode compilation is compilation.

It was pretty clear I meant AoT compilation.

> Which is irrelevant to the point.

Sorry, the fact that typical Rust programming style is much faster than typical Python style is irrelevant to the fact that a Rust tool is faster than its Python competitor? Riiight.

> My thesis is that pip doesn't have to be the way it is in order to actually solve the problem of installing Python packages.

Ok but the actual debate was about whether `uv` is faster because it is written in Rust. The answer is yes because when you put a normal amount of effort into writing Python or Rust you run into all these problems in Python that you don't run into in Rust.

Sure you can defer imports, but that's a pretty uncommon thing to do in Python.

It's like, you wouldn't say "bicycles are just as fast as cars; as long as you attach a jet engine to the bicycle!". Yes, technically possible, but nobody does that.

scottlamb 12/26/2025||
Mine either. Choosing Rust by no means guarantees your tool will be fast—you can of course still screw it up with poor algorithms. But I think most people who choose Rust do so in part because they aspire for their tool to be "blazing fast". Memory safety is a big factor of course, but if you didn't care about performance, you might have gotten that via a GCed (and likely also interpreted or JITed or at least non-LLVM-backend) language.
IshKebab 12/27/2025||
Yeah sometimes you get surprisingly fast Python programs or surprisingly slow Rust programs, but if you put in a normal amount of effort then in the vast majority of cases Rust is going to be 10-200x faster.

I actually rewrote a non-trivial Python program in Rust once because it was so slow (among other reasons), and got a 50x speedup. It was mostly just running regexes over logs too, which is the sort of thing Python people say is an ideal case (because it's mostly IO or implemented in C).

markkitti 12/27/2025||
Summary: They fixed Python packaging by not having to run Python to resolve dependencies. Also, they used Rust.

Moral of the story: Use less Python. Use declarative configuration and other langauges instead.

srikanthdotch 12/28/2025||
I am glad uv exists, I came back to using python regularly because of that. The company behind it "astral" is interesting and they seem to care about developer experience.
hk1337 12/26/2025||
It’s fast because it sucks the life force from bad developers to make them into something good.

Jokes aside…

I really like uv but also really like mise and I cannot seem to get them to work well together.

Onavo 12/27/2025|
Why? They are pretty compatible. Just set the venv in the project's mise.toml are you are good to go. Mise will activate it automatically when you change into the project directory.
hk1337 12/27/2025||
I believe I was trying it the other way around. I installed uv and python with mise but uv still created a .python_version file and using the one installed in the system instead of what was in mise
Woodi 12/28/2025|
LOL

All that years (decades?) Python had build-in code executed on install ??? That's functionally adequate to MS autoexec.bat viruses spreading mechanism!

Just LOL...

More comments...