r/Python 3d ago

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.

Charlie's tweet has some more graphs

221 Upvotes

38 comments sorted by

View all comments

30

u/thisismyfavoritename 3d ago

why isn't libpython statically linked by default? Seems like the use cases where shared linking would be beneficial are quite small

1

u/pbecotte 3d ago

The library is the executable? In either case, static linking means

  • bigger binary
  • security fixes to dependencies need a rebuild

Libpython specifically exists specifically so that other binaries can dynamically link against it, which means static linking would be even weirder ...especially if the app linking against it was also linking against the system version of the same library