How uv got so fast

111 points by xvello


tef

Two tiny nitpicks:

Zero-copy deserialization. uv uses rkyv to deserialize cached data without copying it. The data format is the in-memory format. This is a Rust-specific technique.

This isn't rust specific at all, and there are libraries like FlatBuffers that achieve this in multiple languages!

Lock-free concurrent data structures. Rust’s ownership model makes concurrent access safe without locks. Python’s GIL makes this difficult.

Just to note: Rust's ownership model means that concurrent access needs locks. This is why intrinsics like compare and swap are unsafe in rust, and why lock-free libraries come with some sort of garbage collector. You can't drop things if someone else can read it.

In particular this is one of the reasons that the free threading build of python doesn't immediately free objects upon hitting a refcount of 0, and uses an epoch based reclamation system to actually know when an object is unreachable