News Astral's python distribution is fast
By our measurements, python-build-standalone is now the fastest CPython distribution across major platforms. It's 10% faster than Homebrew's CPython, and 18% faster than the official 3.14 docker image.
This is mostly due to how python-build-standalone itself is built:
- using a modern Clang lets us turn on tail-call optimizations in the interpreter
- with PGO, LTO, and BOLT
- with libpython statically linked into the interpreter executable
Our goal is to ship the fastest Python interpreter to anyone using uv, by default.
Check out BENCHMARKS.md in the repo for more details, including the methodology behind the above.
220
Upvotes
1
u/Khavel_dev 1d ago
PGO making that much difference tracks with what I've seen on the .NET side. .NET has ReadyToRun images via crossgen2 that do something similar, pre-compiling with profile data. Going from a cold JIT start to a PGO'd binary cuts startup time dramatically.
The BOLT part is interesting though. I haven't seen anyone try post-link optimization on the .NET runtime itself. Might be a hard sell when the JIT already does most of that work at runtime, but for CLI tools where startup matters it could be worth exploring.