←back to thread

741 points chirau | 2 comments | | HN request time: 0.602s | source
Show context
AJRF ◴[] No.44358870[source]
Is there something inheret about rust that means its faster at dep resolution than Python? Like where is the speed up coming from?

Or would it be possible to go this fast in python if you cared enough about speed?

Is it a specific thing that rust has an amazing library for? Like Network or SerDe or something?

replies(2): >>44358890 #>>44358912 #
1. simonw ◴[] No.44358912[source]
The biggest speed-up in uv comes from the way it uses caching and hard links. When you install a package into a virtual environment uv uses a hard link to a previously cached version rather than copying files.

Using Rust is responsible for a lot of speed gains too, but I believe it's the hard linking trick (which could be implemented in any language) that's the biggest win.

replies(1): >>44365127 #
2. aragilar ◴[] No.44365127[source]
There's also the assumptions around wheels having consistent metadata (which isn't required in older versions of the specs), so as long as you don't need to support the long tail of packages, then those assumptions are fine (it's worth noting uv weren't the first to make these assumptions, poetry did this too, but pip does not).