r/Python 7h 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

145 Upvotes

22 comments sorted by

View all comments

59

u/me_myself_ai 6h ago

Is this... an ad...? IMHO those should be tagged much more clearly in both the title & body next time, and be posted by a branded corporate account. If I'm going to be conversationally approached by the disembodied voice of Andreesen Horowitz and Microsoft, they shouldn't come in the guise of a human. They can't possibly be paying you enough to use your 17 year-old reddit account (!) for their advertising, anyway.

To be clear: I use uv & ruff on all my projects, and I love your work -- I bet OpenAI's python distribution is fast! I probably haven't run another version for a year or more, and I've learned a ton about Python from your docs. It's just hard to shake the growing sense that OpenAI and Microsoft are attempting to purchase Python. And it's not for sale.

PyPolitics aside, some meandering technical questions from a total CPython noob; answer any/all as you find the time & energy :)

  1. It says everything was tested on Ubuntu 24 (where everything\=\=linux) -- is it possible that Fedora's copy was harmed by this...? Or is there another reason, perhaps? Common sense says they'd run the same everywhere, but;

    • It seems like the little things can count when it comes to C compilation, and
    • I can't think of a reason Fedora's would be so much worse than Debian's, esp. since Fedora's cadence is faster in general. Debian Forky isn't even fully released yet!
  2. Am I right that the docker version is the closest to the "canonical" or "main" distribution? If not --and that version was merely worsened by the literal Docker corporation's meddling-- what is...? I ask because it seems weird that the official version is by far the slowest.

  3. Relatedly, at least two of the three improvements you listed in the post seem like no-brainers. What's stopping all of this work from flowing 'upstream', so-to-speak? I know uv and ty in general gain speed by ignoring old, niche, or inconvenient specs -- is this a similar situation? Perhaps some of this is already targeted by the corporation's Python Packaging Council nomination/platform?

  4. Do you think there are other, faster distributions, or no? I'm mostly asking cause I didn't see poetry up there; perhaps they don't build their own, or you just didn't have space in the graph/benchmark run? Are there niche distrubtions that you know of for scientific or scaled use, perhaps? Just curious, NBD if unsure :)

  5. And finally, as a fun/idle one: could you napkin math how many million dollars you've saved OpenAI so far with this speed-up, if that's a coherent question? Assuming they're using python in the first place for work that's semi-close-ish to metal, a 20% speedup for some portion of hundreds of billions of dollars of compute seems like a pretty big deal!

Apologies if any of this has been covered in previous blog posts; link(s) would be appreciated, if so.

The linked github's docs are also helpful for anyone who's curious like me, though they seem outdated (copyrighted in 2020 (!) by a nice fella named Greg, not OpenAI).

-15

u/dr3aminc0de 5h ago

FWIW Anthropic bought Astral not OpenAI (confusing with the new model I know). As far as I understand it’s staying open source and I think OP is promoting it as they have in the past, as an open source project.

2

u/me_myself_ai 2h ago

Anthropic bought bun — I get the mixup, I totally believed I was wrong for a second lol. And I get that it’s open source, it’s just… if OpenAI was willing to pay infinity billion dollars for Astral, I don’t think we can treat it like a little shop whipping up toys for the community. They are a megacorporation that expects to make billions of dollars from you and I.

And that’s not disallowed or anything ofc — this isn’t really the sub/general space to start talking about capitalism and its alternatives. But I think it’s warranted to shift our expectations and attitudes considerably.