Earlier quoted context omitted.
For me, the speed is the least interesting part of `uv`. What I like about it is what it bundle into a single bin : Managing installed python version, automatically creating local .venv for the project (I don't like software like pipenv who install the venv who knows where in a global directory of their choosing), support of pyproject.toml, including of the python version declared in it, and running script with depen…
For a uv noob like me: what do you mean by bundling it all into a single binary? How does that work?
uv: Deduplicate all files in the wheel cache
91–100 of 126 posts
Re: uv: Deduplicate all files in the wheel cache
#92Earlier quoted context omitted.
(I work on uv) > The only advantage of uv is to have support for parallel async extraction. This isn't true, the biggest speed ups are for the warm cases where we've already unpacked the files into the cache, as notatallshaw mentions above. We can also make low-level optimizations during resolution, e.g., in version parsing, that are not possible in pure Python code. > If pip extracted multiple files/wheels in parall…
> I'm a bit confused by these claims about the GIL? The expensive IO operations release the GIL. FYI: The extraction of files is largely python code that doesn't release the GIL. (cf. the zipfile class from the python interpreter has large layers of abstraction with a massive overhead in python code). Regardless, python packages are thousands of tiny files, so pip never gets to release the GIL for any meaningful dura…
TIL. I ran some benchmarks and confirmed this is the case for many small files as you'd see in wheels — the GIL is released in a meaningful way for larger files though. Thanks!
> This might not give the same result for uv though.
Yeah, I built a prototype and ran some benchmarks. It makes a big difference if the entire wheel is empty files but for any real world examples it's within noise of the baseline.
Re: uv: Deduplicate all files in the wheel cache
#93A 10% reduction in cache size in exchange for a 4% slowdown doesn't seem obviously worthwhile to me, especially when it comes at an increase in complexity.
Making things faster is much easier than making things smaller. I'm sure we can win back a 4% slowdown elsewhere since we have so many more levers to pull from.
This could happen with a user asking their editor to show definition, and then not realizing the result was in some other package, changing it, and saving it, but only if the editor's normal atomic replace mode is disabled. So perhaps that sounds farfetched. But if an AI agent wants to patch some package in a venv, I've seen them bypass the editor and use command line tools to make edits often enough to be concerned. Like corrupting the cache for one package version is already not ideal, and this could potentially affect multiple versions now?
I suppose is this happens the right fix is to nuke the cache completely?
Re: uv: Deduplicate all files in the wheel cache
#94Earlier quoted context omitted.
they just implement the modern PEPs
We do a lot more than that, e.g. how to cache distributions is not defined anywhere within PEPs (and should not be, since it’s a purely internal tool decision). But yes, it helps that uv implements the PEP for detached metadata, particularly during resolution.
Re: uv: Deduplicate all files in the wheel cache
#95Earlier quoted context omitted.
> By using uv, you are literally supporting the people who want to make you unemployed for stock options. By using any FOSS or software produced by software developers and programmers, you are supporting the idea that computation can and should be automated, instead of having humans doing it. This is the origin of computing, and what we've been doing so far, and it continues to "eat the world" via automation, just li…
That is a false equivalency. FOSS started as a counter movement against Microsoft in order to escape from surveillance and corporate control . The AI cartel is the new Microsoft . It is amazing how software developers have been brainwashed. Ted Ts'o, Google employee and pro-AI shill at Debian and LWN, recently argued that supporting AI is similar to supporting the Internet in 2000. That is another fallacy. The Intern…
??? FOSS was around before that, famously so.
The rise of Microsoft made FOSS more important, but FOSS wasn't a reaction to surveillance and control, when it started even multi-user networks were practically unprotected, and it was quite easy indeed to see what other users were up to.
The phone phreaks were the ones who were worried about corporate control of comms, the FOSS people just couldn't figure out why people were paying for software with the hood welded shut when there was better software available to those willing to help contribute to it.
Re: uv: Deduplicate all files in the wheel cache
#96Earlier quoted context omitted.
> The only advantage of uv is to have support for parallel async extraction. If pip extracted multiple files/wheels in parallel without being blocked by the GIL, pip could easily match or outcompete uv. That sounds like it would be relatively easy to demonstrate: You could tweak uv to perform downloads/extractions sequentially and then compare its runtime with pip. Has any such comparison been done?
I haven't done the comparison but it shouldn't be so hard - https://docs.astral.sh/uv/reference/environment/#uv_concurre... - https://docs.astral.sh/uv/reference/environment/#uv_concurre...
The original request to add a concurrency variable in uv was requested by me because, among other things, I wanted to measure the difference between uv and pip: https://github.com/astral-sh/uv/issues/3311
I'm not really following this performance discussion as I think it's gone off the rails.
Re: uv: Deduplicate all files in the wheel cache
#97Earlier quoted context omitted.
It's annoying that most file formats don't checksum their own content. Even formats which should know better, like SQLite, delegate that to the filesystem, most of which are also not checksumed and which delegate that further to the storage. PostgreSQL, which prides itself by it's quality and reliability, only turned on checksums by default in the last version, 18. This is one great benefit of using .zip files as fil…
If you use a filesystem that does checksums, like ZFS, then you'd end up doing it twice for no reason. It makes more sense for archival formats like FLAC, though.
Re: uv: Deduplicate all files in the wheel cache
#98Earlier quoted context omitted.
Imho deduplication belongs at the filesystem level, so the user won't (directly) see it or even know about it. Modern file systems like btrfs have the api for it.
The dedup functionality in something like zfs or btrfs isn't all that great. It tends to be extremely memory hungry and to slow things down significantly. E.g. ZFS needs around 1-5GB of ram per TB of storage and writes need to be compared to a hash table to dedup properly. Using hints or knowledge at the app level is a much better experience if the app can tell the FS that two files are identical. The FS doesn't have…
Re: uv: Deduplicate all files in the wheel cache
#99Earlier quoted context omitted.
Can uv even be used with C extensions now?
It always could.
Re: uv: Deduplicate all files in the wheel cache
#100People say uv is good because it's fast, but honestly I don't care about that. We switched to using it for distribution of our Python-based tools because it makes it very convenient to install directly from a git repository and then to subsequently update from same repository. No need to build a package.
One could also make a comparison to another popular tool, conda, which is glacially slow, but that would arguably be unfair since conda does things uv doesn't.
More generally, it's still a nice thing, though. It's just a little less friction. Even a few seconds slower can nudge you towards different behavior