Top
Best
New

Posted by zdw 1 day ago

How uv got so fast(nesbitt.io)
1113 points | 377 commentspage 4
ec109685 23 hours ago|
The article info is great, but why do people put up with LLM ticks and slop in their writing? These sentences add no value and treats the reader as stupid.

> This is concurrency, not language magic.

> This is filesystem ops, not language-dependent.

Duh, you literally told me that the previous sentence and 50 million other times.

aurumque 23 hours ago|
This kind of writing goes deeper than LLM's, and reflects a decline in both reading ability, patience, and attention. Without passing judgement, there are just more people now who benefit from repetition and summarization embedded directly in the article. The reader isn't 'stupid', just burdened.
twoodfin 22 hours ago||
Indeed, I am coming around in the past few weeks to realization and acceptance that the LLM editorial voice is a benefit to an order of magnitude more hn readers than those (like us) for whom it is ice pick in the nostril stuff.

Oh well, all I can do is flag.

hk1337 20 hours ago||
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 19 hours ago|
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 4 hours ago||
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
PrettyPastry 16 hours ago||
I wish this were enough to get the flake8 devs to accept pyproject support PRs.
dxdm 8 hours ago|
Stop using flake8 and use ruff instead. It's made by the same folks that make uv.
shevy-java 17 hours ago||
Soon uv will deliver results without you even thinking about them beforehand!
nurettin 23 hours ago||
> When a package says it requires python<4.0, uv ignores the upper bound and only checks the lower.

I will bring popcorn on python 4 release date.

yjftsjthsd-h 23 hours ago||
If it's really not doing any upper bound checks, I could see it blowing up under more mundane conditions; Python includes breaking changes on .x releases, so I've had eg. packages require (say) Python 3.10 when 3.11/12 was current.
dev_l1x_be 23 hours ago|||
I always bring popcorn on major version changes for any programming language. I hope Rust's never 2.0 stance holds.
zahlman 22 hours ago||
It would be popcorn-worthy regardless, given the rhetoric surrounding the idea in the community.
pwdisswordfishy 23 hours ago||
> 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: […] Python-free resolution

Umm…

BiteCode_dev 20 hours ago||
Other design decisions that made uv fast:

- uncompressing packages while they are still being downloaded, in memory, so that you only have to write to disk once

- design of its own locking format for speed

But yes, rust is actually making it faster because:

- real threads, no need for multi-processing

- no python VM startup overhead

- the dep resolution algo is exactly the type of workload that is faster in a compiled language

Source, this interview with Charlie Marsh: https://www.bitecode.dev/p/charlie-marsh-on-astral-uv-and-th...

The guy has a lot of interesting things to say.

zahlman 12 hours ago||
> uncompressing packages while they are still being downloaded

... but the archive directory is at the end of the file?

> no python VM startup overhead

This is about 20 milliseconds on my 11-year-old hardware.

collinmanderson 5 hours ago|||
Using the -S (“isolated”) flag can maybe cut startup in half.
BiteCode_dev 11 hours ago|||
HTTP range strikes again.

As for 20 ms, if you deal with 20 dependencies in parallel, that's 400ms just to start working.

Shaving half a second on many things make things fast.

Althought as we saw with zeeek in the other comment, you likely don't need multiprocessing since the network stack and unzip in the stdlib release the gil.

Threads are cheaper.

Maybe if you'd bundle pubgrub as a compiled extension, you coukd get pretty close to uv's perf.

zahlman 32 minutes ago||
Why are you starting a separate Python process for each dependency?
zzzeek 20 hours ago||
> real threads, no need for multi-processing

parallel downloads don't need multi-processing since this is an IO bound usecase. asyncio or GIL-threads (which unblock on IO) would be perfectly fine. native threads will eventually be the default also.

BiteCode_dev 13 hours ago||
Indeed, but unzipping while downloading do. Analysing multiple metadata files and exporting lock data as well.

Now I believe unzip releases the GIL already so we could already benefit from that and the rest likely don't dominate perfs.

But still, rust software is faster on average than python software.

After all, all those things are possible in python, and yet we haven't seen them all in one package manager before uv.

Maybe the strongest advantage of rust, on top of very clean and fast default behaviors, is that it attracts people that care about speed, safety and correctness. And those devs are more likely to spend time implementing fast software.

Thought the main benefit of uv is not that it's fast. It's very nice, and opens more use cases, but it's not the killer feature.

The killer feature is, being a stand alone executable, it bypasses all python bootstrapping problems.

Again, that could technically be achieved in python, but friction is a strong force.

looneysquash 23 hours ago||
I don't have any real disagreement with any of the details the author said.

But still, I'm skeptical.

If it is doable, the best way to prove it is to actually do it.

If no one implements it, was it ever really doable?

Even if there is no technical reason, perhaps there is a social one?

zahlman 21 hours ago||
I guess you mean doing the things in Python that are supposedly doable from Python.

Yeah, to a zeroth approximation that's my current main project (https://github.com/zahlman/paper). Of course, I'm just some rando with apparently serious issues convincing myself to put in regular unpaid work on it, but I can see in broad strokes how everything is going to work. (I'm not sure I would have thought about, for example, hard-linking files when installing them from cache, without uv existing.)

stevemk14ebr 22 hours ago||
What are you talking about, this all exists
zzzeek 20 hours ago|
> pip could implement parallel downloads, global caching, and metadata-only resolution tomorrow. It doesn’t, largely because backwards compatibility with fifteen years of edge cases takes precedence. But it means pip will always be slower than a tool that starts fresh with modern assumptions.

what does backwards compatibility have to do with parallel downloads? or global caching? The metadata-only resolution is the only backwards compatible issue in there and pip can run without a setup.py file being present if pyproject.toml is there.

Short answer is most, or at least a whole lot, of the improvements in uv could be integrated into pip as well (especially parallelizing downloads). But they're not, because there is uv instead, which is also maintained by a for-profit startup. so pip is the loser

More comments...