16 ms·
Python 3.14 is here. How fast is it?
- lumpa 1y agohttps://archive.ph/W0IL2 https://archive.ph/W0IL2
- ModernMech 1y agoI'm thankful they included a compiled language for comparison, because most of the time when I see Python benchmarks, they measure against other versions of Python. But "fast python" is an oxymoron and 3.14 doesn't seem to really change that, which I feel most people expected given the language hasn't fundamentally changed. This isn't a bad thing; I don't think Python has to be or should be the fastest language in the world. But it's interesting to me seeing Python getting adopted for a purpose it wasn't suited for (high performance AI computing). Given how slow it is, people seem to think there's a lot of room for performance improvements. Take this line for instance: > The free-threading interpreter disables the global interpreter lock (GIL), a change that promises to unlock great speed gains in multi-threaded applications. No, not really. I mean, yeah you might get some speed gains, but the chart shows us if you want "great" speed gains you have two options: 1) JIT compile which gets you an order of magnitude faster or 2) switch to a static compiled language which gets you two orders of magnitude faster. But there doesn't seem to be a world where they can tinker with the GIL or optimize python such that you'll approach JIT or compiled perf. If perf is a top priority, Python is not the language for you. And this is important because if they change Python to be a language that's faster to execute, they'll probably have to shift it away from what people like about it -- that it's a dynamic, interpreted language good for prototyping and gluing systems together.
- huflungdung 1y ago[dead]
- IshKebab 1y agoI agree. Unless they make it like 10x faster it doesn't really change anything. It's still a language you only use if you absolutely don't care whatsoever about performance and can guarantee that you never will.
- nodesocket 1y agoIf you’re actually building and shipping software as a business Python is great. The advantages of Python for a startup are many. Large pool of talent that can pickup the codebase on essentially day 1. Fairly easy to reason about, mature, code velocity, typically one and only one way to do things as opposed to JavaScript. There is way more to the story than raw performance.
- OutOfHere 1y agoIt's not that great when you see that the majority of the Python code in businesses is a totally unmaintainable mess because it has incorrect, partial, or no type annotations, and is littered with serious errors that a most basic type checker would flag.
- IshKebab 1y ago> The advantages of Python for a startup are many. Large pool of talent that can pickup the codebase on essentially day 1. Large pool of mediocre Python developers that can barely string a function together in my experience.
- svara 1y agoThe counterargument used to be, the heavy lifting will be offloaded to python modules written in C, like numpy. Which was true, but maybe not the strongest argument. Why not use a faster language in the first place? But it's different now. There's huge classes of problems where pytorch, jax &co. are the only options that don't suck. Good luck competing with python code that uses them on performance.
- bowsamic 1y ago> Why not use a faster language in the first place? Well for the obvious reason that there isn't really anything like a Jupyter notebook for C. I can interactively manipulate and display huge datasets in Python, and without having to buy a Matlab license. That's why Python took off in this area, really
- kstrauser 1y agoI've been writing Python professionally for a couple of decades, and there've only been 2-3 times where its performance actually mattered. When writing a Flask API, the timing usually looks like: process the request for .1ms, make a DB call for 300ms, generate a response for .1ms. Or writing some data science stuff, it might be like: load data from disk or network for 6 seconds, run Numpy on it for 3 hours, write it back out for 3 seconds. You could rewrite that in Rust and it wouldn't be any faster. In fact, a huge chunk of the common CPU-expensive stuff is already a thin wrapper around C or Rust, etc. Yeah, it'd be really cool if Python itself were faster. I'd enjoy that! It'd be nice to unlock even more things that were practical to run directly in Python code instead of swapping in a native code backend to do the heavy lifting! And yet, in practice, its speed has almost never been an issue for me or my employers. BTW, I usually do the Advent of Code in Python. Sometimes I've rewritten my solution in Rust or whatever just for comparison's sake. In almost all cases, choice of algorithm is vastly more important than choice of language, where you might have: * Naive Python algorithm: 43 quadrillion years * Optimal Python algorithm: 8 seconds * Rust equivalent: 2 seconds Faster's better, but the code pattern is a lot more important than the specific implementation.
- ModernMech 1y agoExactly, most Python devs neither need nor care about perf. Most applications don't even need perf, because whether it's .1 second or .001 seconds, the user is not going to notice. But this current quest to make Python faster is precisely because the sluggishness is noticeable for the task it's being used for most at the moment. That 6 second difference you note between the Optimal Python and the optimal Rust is money on the table if it translates to higher hardware requirements or more server time. When everything is optimal and you could still be 4x faster, that's a tough pill to swallow if it means spending more $$$.
- OutOfHere 1y ago> most Python devs neither need nor care about perf. You do understand that's a different but equivalent way of saying, "If you care about performance, then Python is not the language for you.", don't you?
- famouswaffles 1y agoIt's pretty simple. Nobody wants to do ML R&D in C++. Tensorflow is a C++ library with python bindings. Pytorch has supported a C++ interface for some time now, yet virtually nobody uses C++ for ML R&D. The relationship between Python and C/C++ is the inverse of the usual backend/wrapper cases. C++ is the replaceable part of the equation. It's a means to an end. It's just there because python isn't fast enough. Nobody would really care if some other high perf language took its place. Speed is important, but C++ is even less suited for ML R&D.
- whatever1 1y agoI think readability is what made python a winner. I can quickly type down my idea like a pseudo code, I can easily skim through other people’s algos. In C++ even a simple algo with a 100 lines of pseudo code will balloon to thousands of lines in c++
- Phelinofist 1y agoPithon, haha
- DonHopkins 1y agoOr Pijthon in Dutch.
- kps 1y agoNot Pijthon?
- kstrauser 1y agoI feel like I’m having a stroke.
- DonHopkins 1y agoYou should hear the Dutch say "yah-vah-shchkript" with a throat clear and spit take.
- tremon 1y agoThe Dutch pronunciation of javascript differs from the English one only in the first syllable. Roughly zero dutchies would insert the Dutch schr- sound in a loanword, and even fewer would do that while leaving the foreign -ipt suffix intact.
- DonHopkins 1y agoMaybe they're just taking advantage of the opportunity to expectorate then.
- vram22 1y agoHej! Nijce!
- gweinberg 1y ago
- d_silin 1y agoFor quick and dirty Python benchmark, try https://github.com/DarkStar1982/fast_langton_ant/ https://github.com/DarkStar1982/fast_langton_ant/ Run as "python3 server.py -s 10000000 -n"
- nadermx 1y agoTangential, but I practically owe my life to this guy. He wrote the flask mega tutorial in what I followed religiously to launch my first website. Then right before launch, in the most critical part of my entire application; piping a fragged file in flask. He answered my stackoverflow question, I put his fix live, and the site went viral. Here's the link for posterity's sake https://stackoverflow.com/a/34391304/4180276 https://stackoverflow.com/a/34391304/4180276
- svieira 1y agoNice story! My guess is that the site was https://yout.com/ https://yout.com/ given your profile. Does it still run Flask?
- nadermx 1y agoIt's all grown up now. Runs on Django for the admin panel. Not that flask ever failed. Just became easier to manage the user base that way.
- swyx 1y agobecause of Django admin? any downsides/notable warnings for people considering Flask v Django? any migration guide that's helpful?
- devjab 1y agoTo limit the amount of languages we support I recently rewrote one of our backend services from Go (with SQLC) to Python. I hadn't worked with Python "web" for a while and started with Litestar and also their Advanced-Alchemy. Part of the reason was that their DTO's and dataclasses seemed like a good way to skip Pydantic. Anyway, once models became complext it wasn't easy to skip Pydantic and it also wasn't easy to deal with Advanced Alchemy. One afternoon I got so annoyed with it I rewrote everything with Django Ninja. It took me 4-5 hours that evening to recreate all the previous weeks stuff with Django because of how good the batteries included are. I'm not sure I'd ever use any other web framework than Django going forward, and I'm not using half of it (including the admin). I think Litestar is great by the way, Django is just so easy to produce with.
- mherrmann 1y agoPi-thon
- didip 1y agoEvery time I hear news about Python language itself, it sadden me that, in 2025, PyPy is still a separate distinct track from mainline Python. That said, I wonder if GIL-less Python will one day enable GIL-less C FFI? That would be a big win that Python needs.
- nu11ptr 1y ago> That said, I wonder if GIL-less Python will one day enable GIL-less C FFI? That would be a big win that Python needs. I'm pretty sure that is what freethreading is today? That is why it can't be enabled by default AFAIK, as several C FFI libs haven't gone "GIL-less" yet.
- petters 1y ago> That said, I wonder if GIL-less Python will one day enable GIL-less C FFI? What do you mean exactly? C FFI has always been able to release the GIL manually.
- cap11235 1y ago[flagged]
- rowanG077 1y agoWho are you talking about? Python hasn't had a dictator for ages now.
- otabdeveloper4 1y agoHe's right in everything else though.
- deleted 1y ago[deleted]
- freddie_mercury 1y agoGuido stepped down over 7 years ago. How out of touch are you?
- LigmaBaulls 1y agoI would tell you a joke about python but it would take you a long time to get it.
- kps 1y agoYou can tell me a joke about Python, but I'll need someone to interpret it.
- Octoth0rpe 1y agoAt least you eventually get it. I regularly don't get UDP jokes.
- flykespice 1y agoAt least you can come up with a joke quickly with Python
- BobbyTables2 1y agoYeah, but it requires a script!
- amelius 1y agoI hope it doesn't get stuck at 3.14, like TeX. https://www.reddit.com/r/RedditDayOf/comments/7we430/donald_knuths_typesetting_system_tex_has_a/ https://www.reddit.com/r/RedditDayOf/comments/7we430/donald_...
- feoren 1y agoYou hope it doesn't? > [Donald Knuth] firmly believes that having an unchanged system that will produce the same output now and in the future is more important than introducing new features This is such a breath of fresh air in a world where everything is considered obsolete after like 3 years. Our industry has a disease, an insatiable hunger for newness over completeness or correctness. There's no reason we can't be writing code that lasts 100 years. Code is just math. Imagine having this attitude with math: "LOL loser you still use polynomials!? Weren't those invented like thousands of years ago? LOL dude get with the times, everyone uses Equately for their equations now. It was made by 3 interns at Facebook, so it's pretty much the new hotness." No, I don't think I will use "Equately", I think I'll stick to the tried-and-true idea that has been around for 3000 years. Forget new versions of everything all the time. The people who can write code that doesn't need to change might be the only people who are really contributing to this industry.
- pooyamo 1y agoSome stuff like LAPACK and BLAS fit your bill. They are math libraries written decades ago and still in use.
- Q6T46nT668w6i3m 1y agoLAPACK and OpenBLAS regularly release new versions
- bitwize 1y agoExcept uh, nobody uses infinitesimals for derivatives anymore, they all use limits now. There's still some cruft left over from the infinitesimal era, like this dx and dy business, but that's just a backwards compatibility layer. Anyhoo, remarks like this are why the real ones use Typst now. TeX and family are stagnant, difficult to use, difficult to integrate into modern workflows, and not written in Rust.
- moralestapia 1y agoVery interesting post, thanks for putting it together. Rust is indeed quite fast, I thought NodeJS was much better tbh., although it's not bad. I'd be interested to learn what's holding it back because I've seen many implementations where V8 can get C++-like performance (I mean it's C++ after all). Perhaps there's a lot of overhead in creating/destroying temporary objects.
- miguelgrinberg 1y agoOne reason is that I did not spend much time optimizing the Node and Rust versions, I just translated the Python logic as directly and quickly as I could. At least I did not ask an LLM to do it for me, which I hope counts. ;-) Edit: fixed a couple of typos.
- kstrauser 1y ago> V8 can get C++-like performance (I mean it's C++ after all) I don’t think that follows. Python is written in C, but that doesn’t mean it can get C-like performance. The sticking point is in how much work the runtime has to do for each chunk of code it has to execute. (Edit: sorry, that’s in reply to another child content. I’m on my phone in a commute and tapped the wrong reply button.)
- jerf 1y agoV8 gets C++-like performance when it is getting code that JITs very well. This is typically highly-numeric code, even sometimes tuned specifically for the JIT. This tends to cause a great deal of confusion when people see the benchmarks for that highly numeric code and then don't understand why their more conventional code doesn't get those speeds. It's because those speeds only apply to code you're probably not writing. If you are writing that sort of code, then it does apply; the speed for that code is real. It's just that the performance is much more specific than people think it is. In general V8 tends to come in around the 10x-slower-than-C for general code, which means that in general it's a very fast scripting language, but in the landscape of programming languages as a whole that's middling single-thread performance and a generally bad multiprocessing story.
- rFlex 1y ago
- modeless 1y agoWhat are the reasons why nobody uses pypy?
- throwaway314155 1y agoYeah I'm curious about this myself. Seems to utterly destroy CPython in every one of those benchmarks.
- miguelgrinberg 1y agoKeep in mind that the two scripts that I used in my benchmark are written in pure Python, without any dependencies. This is the sweet spot for pypy. Once you start including dependencies that have native code their JIT is less efficient. Nevertheless, the performance for pure Python code is out of this world, so I definitely intend to play more with it!
- redsymbol 1y agoIt currently only supports Python 3.11. That is a big reason.
- lucb1e 1y agoI was happy to see it supports a fairly recent Python3 at all now, like Py3.5 or what is it that ships with most of the expected stuff? Works for me, I'd target something like that for compatibility anyway
- deleted 1y ago[deleted]
- kccqzy 1y agoBecause in the real world, for code where performance is needed, you run the profiler and either find that the time is spent on I/O, or that the time is spent inside native code.
- lenerdenator 1y agoAlso, that engineer time you would spend optimizing for performance costs more than just throwing more hardware at it.
- veber-alex 1y agoThe most interesting part for me is that PyPy is faster than free threaded CPython even on multi threaded code.
- username223 1y agotl;dr: Two orders of magnitude slower than Rust, so 2-3 orders slower than native. Python on a 2 GHz processor runs as fast as C on a 2-20 MHz processor.
- throwaway314155 1y ago*for very specific benchmarks, not "on average"
- morshu9001 1y agoquick n dirty Python code will run faster than quick n dirty C++ code
- username223 1y agoTrue, Python could be better or worse than two orders of magnitude slower for your particular use case, but it's 70x slower for recursion and addition that it clearly hasn't special-cased. That's good to know.
- igouy 1y agoWell, if that's good to know -- https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/comparable.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- repsilat 1y agoFor compute-heavy code "100x slower than C++" is a good rule of thumb in my experience in python 3.10.
- throwaway314155 1y agoMaybe when you are reinventing the wheel instead of using e.g. numpy, Jax, PyTorch. Python is an ecosystem some of which is tooling built in C/C++. There’s no reason to ignore those libraries just because C devs like to roll their own everything.
- alfalfasprout 1y ago> And this is a bit disappointing. At least for this test, the JIT interpreter did not produce any significant performance gains, so much that I had to double and triple check that I used a correctly built interpreter with this feature enabled. I do not know much about the internals of the new JIT compiler, but I'm wondering if it cannot deal with this heavily recursive function. FWIW one thing that is worth calling out here is that the initial goal for JIT right now in Python is getting it relatively stable, functional, and more or less getting the initial implementation out there. It's not surprising at all that it's not faster. I say this because I think the teams working on free-threaded and JIT python maybe could have done a better job publicly setting expectations.
- 3eb7988a1663 1y agoI mean, Guido had a 2021 Faster CPython presentation where they claimed "5x in 4 years (1.5x per year)"[0]. Developers have significantly walked back those expectations since then. [0] Github slide deck https://github.com/faster-cpython/ideas/blob/main/FasterCPythonDark.pdf https://github.com/faster-cpython/ideas/blob/main/FasterCPyt...
- alfalfasprout 1y agoOne important caveat to remember is that this is before a lot of the work on free-threaded python started in full force. A lot of cutting edge work had to be done to support this in the GC but this came with performance penalties. As a result, the trajectory of the Faster CPython effort changed quite a bit. Didn't help Microsoft axed several folks on that team too...
- pansa2 1y ago> Didn't help Microsoft axed several folks on that team too... Only after the four-year period was over, during which they only delivered a 1.5x - 2x speedup instead of the projected 5x.
- 3eb7988a1663 1y agoSure, reality is a harsh mistress, but those were really optimistic targets which were used to frame a lot of the development efforts.
- BurningFrog 1y agoLet this version be known as PiPy!
- cat-whisperer 1y agoYeah honestly I don't really care about these benchmarks. Python isn't built for raw performance and that's totally fine! It's the number one choice for prototyping and can do so much, that's what actually matters. I think it's cool they're working on speed improvements though, means my prototype-to-production cycle gets a bit smoother lol.
- semiinfinitely 1y agohonestly if the performance of the python interpreter has a big impact on your application's performance and that's something you care about - you're already doing things very wrong
- Curzel 1y agoPy = 3.14 :')
- octo888 1y agoHere's hoping they make 16 patch versions
- teaearlgraycold 1y agoDoes 3.14.0 count as one of those 16? I’m more interested in the 3.14.15 than the correctly rounded up 3.14.16.
- octo888 1y agoYes hah. > I’m more interested in the 3.14.15 That was indeed the joke
- lapetitejort 1y agoI hope they speedrun to Python 6.28 because tau > pi (mini unrelated rant. I think pi should equal 6.28 and tau should equal 3.14, because pi looks like two taus)
- andyferris 1y ago> I think pi should equal 6.28 and tau should equal 3.14, because pi looks like two taus Ha. Undeniable proof that we had them backwards all along!
- mwkaufma 1y agomore like "pi"thon
- lenerdenator 1y agoThat >2x performance increase over 3.9 in the first test is pretty impressive. A narrow use case for sure, but assuming you can leave your code completely alone and just have it run on a different interpreter via a few CLI commands, that's a nice bump.
- curiousityargh 1y agoKinda curious. Have you figured out why the code runs faster on a Mac?
- b3orn 1y agoIt's two different computers with different CPUs, so different runtimes are expected and has nothing to do with the OS. > Framework laptop running Ubuntu Linux 24.04 (Intel Core i5 CPU) > Mac laptop running macOS Sequoia (M2 CPU)
- cap11235 1y agoYes, and why? way to not address the question at all.
- Rohansi 1y agoAre you asking why the M2 is faster than the i5?
- kindaagains 1y agoWell I was asking whether there is something in the Mac Kernel which makes it faster or is it just the different CPUs/Memory that account for this?
- Rohansi 1y agoAccording to general benchmarks Apple Silicon is the highest performing CPU for single-threaded work. It'll be hard to confirm how much of a difference the OS factors in but the hardware difference is most likely why.
- nisten 1y agoIt's slow. Get back to work.
- teaearlgraycold 1y agoGet back to writing in other languages when speed matters.
- librasteve 1y agoVery nice post - it's good to see benchmarks done for humans. For fun, I tried this in Raku: (0, 1, *+* ... *)[40] #0.10s user 0.03s system 63% cpu 0.214 total lol Seriously, Python is doing great stuff to squeeze out performance from a scripting language. Realistically, Raku has fewer native libraries (although there is Inline::Python) and the compiler still has a lot of work to get the same degree of optimisation (although one day it could compare). EDIT: for those who have commented, yes you are correct … this is a “cheat” and does not seek to state that Raku is faster than Python - as I said Raku still has a lot of work to do to catch up.
- lucb1e 1y agoI take it this is supposed to be the equivalent of fib(40), which ran on the author's system in Pyπ in 6.59 seconds and apparently on yours, with Raku, in 0.21? Do you have the same hardware as the author or should one of you run the other's variant to make this directly comparable?
- OskarS 1y agoNo, this is very much not the same. The Raku version is like writing this in Python: def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a+b And taking the 40th element. It's not comparable at all to the benchmark, that's deliberately an extremely slow method of calculating fibonacci numbers for the purpose of the benchmark. For this version, it's so fast that the time is dominated by the time needed to start up and tear down the interpreter.
- zahlman 1y agoWell, sure; you're using dynamic programming, while the stress test Python Fibonacci code is deliberately using recursion without memoization — it makes function calls proportionate to the number computed. Most of the time you're seeing in the Raku code is the interpreter startup. Python doesn't have syntax strongly oriented towards that sort of trick (it's not as strong of a second-best APL as it is a second-best Lisp or Haskell), but: $ python -m timeit "x = (1, 0); [x[0] for _ in range(40) if (x := (x[0] + x[1], x[0]))][-1]" 50000 loops, best of 5: 4 usec per loop (Or a "lazy iterator" approach:) $ python -m timeit --setup 'from itertools import islice, count' 'x = (1, 0); next(islice((x[0] for _ in count() if (x := (x[0] + x[1], x[0]))), 40, None))' 50000 loops, best of 5: 5.26 usec per loop
- bfrog 1y agotl;dr... It's still not fast
- dzonga 1y agoseems loved languages such as python & ruby (ZJIT | TruffuleRuby) have been getting a lot performance improvements lately. of course JS with v8 kickstarted this - followed by PHP. so for majority of us folks use what you love - the performance will come.
- CuriouslyC 1y agoAs someone who was a hardcore python fanboy for a long time, no, no it won't. There are classes of things that you can only reasonably do in a language like rust, or where go/kotlin will save you a crazy amount of pain. Python is fine for orchestration and prototyping, but if it's the only arrow you have in your quiver you're in trouble.
- morshu9001 1y agoI even changed to JS as my fave for backends. Still using Py for other stuff ofc, but I'm constantly missing some of the JS niceties.
- acomjean 1y agoI know sometimes performance doesn’t matter, and python is certainly useful, but it’s not fast. It can be fast enough and they’ve put a lot of effort into making fast libraries (called in c). When doing bioinformatics we had someone update/rewrite a tool in java and it was so much faster. Went from a couple days to some like 4 hours of runtime. Python certainly can be used in production (my experience maintaining some web applications in Java would make me reach for python/php/ruby to create a web backend speed be dammed). Python has some great libraries.
- DonHopkins 1y agoAt least Python doesn't have an extremist "100% Pure" ideology like Java, and instead (like TCL and Lua) it's been designed from the ground up for easily integrating with other languages and libraries, embedding, and extending, instead of Java's intolerantly weaponized purity and linguistic supremacy. Reasons why Sun and Java failed: Strategy over product. McNealy cast Java as a weapon of mass destruction to fight Microsoft, urging developers to "evangelize Java to fight Microsoft." That fight-first framing made anti-Microsoft positioning the goal line, not developer throughput. Purity over pragmatism. Sun’s "100% Pure Java" program explicitly banned native methods and dependencies outside the core APIs. In practice, that discouraged bridges to real-world stacks and punished teams that needed COM/OS integration to ship. (Rule 1: "Use no native methods.") "100% Pure Java" has got to be one of the worst marketing slogans in the history of programming languages, signaling absolutism, exclusion, and gatekeeping. And it was technically just as terrible and destructive an idea that held Java back from its potential as an inclusive integration, extension, and scripting language (especially in the web browser context, since it was so difficult to integrate, that JavaScript happened instead and in spite of Java). Lua, Python, and even TCL were so much better and successful at embedding and extending applications than Java ever was (or still is), largely because they EMBRACED integration and REJECTED "purity". Java's extremist ideological quest for 100% purity made it less inclusive and resilient than "mongrel" languages and frameworks like Lua, Python, TCL, SWIG, and Microsoft COM (which Mozilla even cloned as "XP/COM"), that all purposefully enabled easy miscegenation with existing platforms and libraries and APIs instead of insanely insisting everyone in the world rewrite all their code in "100% Pure Java". That horrible historically troubling slogan was not just a terrible idea technically and pragmatically, but it it also evoked U.S. nativist/KKK's "100% Americanism", Nazi's "rassische Reinheit", "Reinhaltung des Blutes", and "Rassenhygiene", Fascist Italy's "La Difesa della Razza", and white supremacist's "white purity". It's no wonder Scott McNealy is such a huge Trump supporter! While Microsoft courted integrators. Redmond pushed J/Direct / Java-COM paths, signaling "use Windows features from Java if that helps you deliver." That practicality siphoned off devs who valued getting stuff done over ideological portability. Community as militia. The rhetoric ("fight," "evangelize") enlisted developers as a political army to defend portability, instead of equipping them with first-rate tooling and sanctioned interop. The result: cultural gatekeeping around "purity" rather than unblocking use cases. Ecosystem costs. Tooling leadership slid to IBM’s aptly named Eclipse (a ~$40M code drop that became the default IDE), while Sun’s own tools never matched Eclipse’s pull: classic opportunity cost of campaigning instead of productizing. IBM's Eclipse cast a dark shadow over Sun's "shining" IDE efforts, which could not even hold a candle to Microsoft's Visual Studio IDE that Sun reflexively criticized so much without actually bothering to use and understand the enemy. At least Microsoft and IBM had the humility to use and learn from their competitor's tools, in the pursuit of improving their own. Sun just proudly banned them from the building, cock-sure there was nothing to learn from them. And now we are all using polyglot VSCode and Cursor, thanks to Microsoft, instead of anything "100% Pure" from Sun! Litigation drain. Years of legal trench warfare (1997 suit and 2001 settlement; then the 2004 $1.6B peace deal) defended "100% Pure Java" but soaked time, money, and mindshare that could have gone to developer-facing capabilities. Optics that aged poorly. The very language of "purity" in "100% Pure Java" read as ideological and exclusionary to many -- whatever Sun's presumed intent -- especially when it meant "rewrite in Java, don’t integrate." The cookbook literally codified "no native methods," "no external libraries," and even flagged Runtime.exec as generally impure. McNealy’s self-aggrandizing war posture did promote Java’s cross-platform ideal, but it de-prioritized developer pragmatism -- stigmatizing interop, slow-rolling mixed-language workflows, and ceding tools leadership -- while burning years on lawsuits. If your priority was "ship value fast," Sun’s purity line often put you on the wrong side of the border wall. And now finally, all of Java's remaining technical, ideological, and entrenched legacy enterprise advantages don't matter any more, alas, because they are all overshadowed by the unanthropomorphizable lawnmower that now owns it and drives it towards the singular goal of extracting as much profit from it as possible.
- deleted 1y ago[deleted]
- Exoristos 1y agoSo, Π-thon?
- fnicfnac 1y agoNo comparison to Python 2.7.18.
- hamonrye 1y agoobject oriented developer language, whereas the API is the mass-production of backend apps
- haberman 1y agoDo any of these tests measure the new experimental tail call interpreter (https://docs.python.org/3.14/using/configure.html#cmdoption-with-tail-call-interp https://docs.python.org/3.14/using/configure.html#cmdoption-...)? I couldn't find any note of it, so I would assume not. It would be interesting to see how the tail call interpreter compares to the other variants.
- miguelgrinberg 1y agoThe build of Python that I used has tail calls enabled (option --with-tail-call-interp). So that was in place for the results I published. I'm not sure if this optimization applies to recursive tail calls, but if it does, my Fibonacci test should have taken advantage of the optimization.
- emil-lp 1y agoIt wouldn’t have, since fib(n-1) + fib(n-2) isn’t a tail call—there’s work left after the recursive calls, so the tail call interpreter can’t optimize it.
- ufo 1y agoThe tail calls in question are C tail calls inside the inner interpreter loop. They have nothing to do with Python function calls.
- miguelgrinberg 1y agoThat tells you how much I know about the feature. :) But in any case, I'm positive that the flag was enabled, so my results are with tail calls. I suppose part of the difference between 3.13 and 3.14 could be thanks to this.
- haberman 1y agoGood to know! Thanks for confirming. Yes, I would guess that the tail call interpreter explains part of the difference between 3.13 and 3.14. Previously the overall improvement to the interpreter has been measured at 1-5%, or even 10-15% depending on the compiler version you are using: https://blog.nelhage.com/post/cpython-tail-call/ https://blog.nelhage.com/post/cpython-tail-call/ If your benchmark setup is easy to re-run, it would be awesome to see numbers that compare the tail call interpreter to the build where it is disabled, to isolate how much improvement is due to that.
- anaccount342 1y agoI don't know how realistic only using a benchmark that only uses tight loops and integer operations. Something with hashmaps and strings more realistically represents everyday cpu code in python; most python users offload numeric code to external calls.
- gsibble 1y agoOr have it run some super common use case like a FastAPI endpoint or a numpy calculation. Yes, they are not all python, but it's what most people use Python for.
- miguelgrinberg 1y agoFastAPI is a web framework, which by definition is (or should be!) an I/O bound process. My benchmark evaluates CPU, so it's a different thing. There are a ton of web framework benchmarks out there if you are interested in FastAPI and other frameworks. And numpy is a) written in C, not Python, and b) is not part of Python, so it hasn't changed when 3.14 was released. The goal was to evaluate the Python 3.14 interpreter. Not to say that it wouldn't be interesting to evaluate the performance of other things as well, but that is not what I set out to do here.
- KeplerBoy 1y agoThat's the thing with Python: A lot of things should be bound by all kinds of limitations, but are in practice often limited by the Python interpreter if not done carefully. Fundamentally for example, if you're doing some operations on numpy arrays like: c = a + b * c, interpreted numpy will be slower than compiled numba or C++ just because an eager interpreter will never fuse those operations into an FMA.
- xmcqdpt2 1y agoNumpy is partly written in C but includes a lot of Python code. If you include scipy or scikit learn or pandas, most of the code is python calling primitive numpy C operations. I'd expect that many semi-complex data science programs to benefit from improvement in the python interpreter, especially if they weren't written in super tight numpy code.
- deleted 1y ago[deleted]
- notepad0x90 1y ago3.1415.. Pithon??
- robotnikman 1y agoMy first thought as well lol
- sedatk 1y agocalled it https://bsky.app/profile/ssg.dev/post/3lwyoye7suk26 https://bsky.app/profile/ssg.dev/post/3lwyoye7suk26
- sroussey 1y agoPlease don’t make benchmarks with timing inside the loop creating a sum. Just time the loop and divide by the number. Stuff happens getting the time and the jitter can mess with results.
- 8organicbits 1y agoI'll plug timeit, from the standard library as a good approach. https://docs.python.org/3/library/timeit.html https://docs.python.org/3/library/timeit.html
- mjevans 1y agoThe real world benchmark is measuring it from invocation, both for cold launches and 'hot' (data cached from the last run). Interestingly I might have only ever used the time (shell) builtin command. GNU's time measuring command prints a bunch of other performance stats as well.
- rocqua 1y agoI'm annoyed every time I have to write $(which time). But the stats given by -v are just so much more valuable from gnu-time.
- Tom1380 1y agoWouldn't it also work with "env time" if that's easier to type?
- deleted 1y ago[deleted]
- aaronmdjones 1y agoIt would also work to just write 'time' Quoting overrides aliases and builtins. $ 'time' -v -- echo hi hi Command being timed: "echo hi" [...]
- 1y ago
- ronbenton 1y agoPi-thon
- Havoc 1y agoReally pleasing to see how smooth the non-GIL transition was. If you think about 2->3 python this was positively glorious. And that it gets into spitting range of standard so fast is really promising too. That hopefully means the part not compatible with it get flushed out soon-ish
- defraudbah 1y agoit still has GIL, likely a few more versions until we get rid of it
- jabl 1y agoAFAIU GIL is still the default, and no-GIL is a build option, you can't select it at runtime. The big issue is what about all those C extension modules, some of them might require a lot of changes to work properly in a no-GIL world.
- js2 1y ago> Free-threaded builds of CPython support optionally running with the GIL enabled at runtime using the environment variable `PYTHON_GIL` or the command-line option `-X gil`. https://docs.python.org/3/howto/free-threading-python.html https://docs.python.org/3/howto/free-threading-python.html
- thaumasiotes 1y agoAha, the perfect time for Python to adopt the TeX version numbering system.
- Iuz 1y agoIs fold comment a option based on karma or something? I loved the most voted post here on how Miguel helped the guy but, it is unrelated and for the first time I guess I realized there is no fold so I can go to people actually talking about the article...
- 201984 1y agoYou got more karma than me, so you're probably just looking past it. It's the [-] button on the right end of the comment header, just to the right of the "next" button.
- Vitaly_C 1y agoPi-thon?
- oofbey 1y agoI’m very glad python is getting faster. But the correct answer to “Is Python Really That Slow?” is unambiguously YES. Unless you’re using some ML library like torch or numpy which spends all its time in optimized C code, python is still EXTREMELY slow. We are going to need a lot of these 10% improvements for python to be comparable to Go, Java, or Node, each of which are about 30x faster on typical computer tasks.
- kazinator 1y agoPi-thon?
- aussieguy1234 1y agoI started using Python again recently after a 15 year break. The reason was I started working with LangChain, specifically LangGraph agents. The JavaScript/TypeScript versions are months behind. In the AI world with the progress thats been made recently, months might as well be years.
- deleted 1y ago[deleted]
- asasidh 1y agoCan we call it Py Pi ?
- youngbum 1y agopi-thon
- 1vuio0pswjnm7 1y agoOnly tested against NodeJS and Rust What about Lua and LuaJIT
- johnisgood 1y agoIn my experience LuaJIT is extremely fast in comparison to Python. Perl is faster, too.
- pansa2 1y agoI did some recent testing that showed both Lua and LuaJIT-joff (its interpreter-only mode) to be about 2x faster than Python. Both PyPy and full-on LuaJIT were about 10x faster. Years ago, I even found Ruby to be faster than Python. This was back in the Ruby 2.0 / Python 3.5 days - I'd be interested to know if it's still the case.
- igouy 1y agohttps://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/ruby-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/comparable.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- 1vuio0pswjnm7 1y agoIf faster language interpreters were included in the tests, the title could be "Python 3.14 is here. How slow is it?" It would be interesting to test intepreter startup time across various intepreter including Python
- nullorempty 1y ago'3.14159265359...' - there is a lot of room to grow - keep it at pi
- zeroonetwothree 1y agoπthon
- ctkqiang96 1y agoSo finally we can call it π-thon?
- DeathArrow 1y agoI feel like Python should be much faster already. With all the big companies using Python and it's huge popularity I would have expected that a lot of money, work and research would be put into making Python faster and better.
- ActorNightly 1y agoWhy? There are other languages you can use to make stuff go fast. Python isn't for making stuff go fast. Its for rapid dev, and that advantage matters way more when you already are going to be slow due to waiting for network response
- lunias 1y agoThis has always confused me... is Python really that much better at rapid dev? I work on a Python project and every day I wish the people that started the project had chosen a different language that actually scaled well with the problem rather than Python, which they likely chose because it was for "rapid dev".
- ActorNightly 1y agoYou can run Python processes in parallel for "scaling". Youtube and Uber run python backends. This is cheaper than developer time per hour.
- lunias 1y agoSure, there's multiprocessing, but historically no multithreading (relatively recently there is the free-threading interpreter). Each of those processes / threads will also execute slowly compared to most other languages. But we agree Python is not performance oriented... I'm just curious why people think it's a good trade-off when I suspect that writing the same code in say, Java, will take roughly the same time, be easier to maintain (compiler assisted refactoring, type safety, etc), and execute faster.
- wbolt 1y agoMore than 300 comments here and still no convincing answer. Why the community wastes time on trying to make CPython faster when there is pypy which is already much faster? I understand pypy lacks libraries and feature parity with up to date CPython. But… can’t everyone refocus the efforts and just move to pypy to add all the missing bits and then just continue with pypy as the “official python”? Are there any serious technical reasons not to do it?
- otabdeveloper4 1y ago> pypy which is already much faster It isn't.
- wbolt 1y agoYes it is.
- bjoli 1y agoFor all my applications, going to PyPy was an instant 2x improvement. Not only that, it is a lot easier to hack on. I might be biased, but the whole implementstion idea of PyPy seems a lot more sane.
- MobiusHorizons 1y agoI think for pure python performance it is significantly faster at least on all the benchmarks I have seen. That said a lot of what people actually do in python calls into libraries that are written in C++ or C, which I believe has a similar performance (when it works) on pypy.
- physicsguy 1y ago> when it works This is the problem!
- selcuka 1y ago> can’t everyone refocus the efforts You have answered your own question. Seriously, though. PyPy is 2-3 versions behind CPython (3.11 vs 3.14) and it's not even 100% compatible with 3.11. Libraries such as psycopg and lxml are not fully supported. It's a hard sell.
- dhosek 1y agoHow did they not take the opportunity with this version to rename it pi-thon?
- nxpnsv 1y agoBecause they knew you would…
- belter 1y agoFor a while the language will be named PIthon
- guardian5x 1y agoGees, Rust is fast!
- Harmon758 1y agoFor all those making πthon jokes: https://github.com/python/cpython/pull/125035 https://github.com/python/cpython/pull/125035
- wigster 1y agopython pi!
- stabbles 1y agoPython installation size over time: 170M python-3.6.15 183M python-3.7.17 197M python-3.8.20 206M python-3.9.24 218M python-3.10.19 331M python-3.11.14 362M python-3.12.12 377M python-3.13.8 406M python-3.14.0
- slightwinder 1y agoWith batteries included, growing should be a desired outcome.
- Too 1y agoNot always. See dead batteries: https://peps.python.org/pep-0594/ https://peps.python.org/pep-0594/
- ptx 1y agoWhere are you getting these numbers? Python 3.11 on Debian is around 21 MB installed size (python3.11-minimal + libpython3.11-minimal + libpython3.11-stdlib), not counting common shared dependencies like libc, ncurses, liblzma, libsqlite3, etc. Looking at the embeddable distribution for Windows (32-bit), Python 3.11 is 17.5 MB unpacked, 3.13 is slightly smaller at 17.2 MB and 3.14 is 18.4 MB (and adds the _zstd and _remote_debugging modules).
- stabbles 1y agoThis is the "standard" configure + make + make install, which includes libpython.a, header files, Python's own tests (python -m test), plus __pycache__, and debug symbols. Distros of course may split it up into multiple packages, split out debug symbols, etc. See `docker run -it --rm -w /store ghcr.io/spack/all-pythons:2025-10-10`. To be fair, the main contributors are tests and the static library. Just looking at libpython.so 10M libpython3.6m.so.1.0 11M libpython3.7m.so.1.0 13M libpython3.8.so.1.0 14M libpython3.9.so.1.0 17M libpython3.10.so.1.0 24M libpython3.11.so.1.0 30M libpython3.12.so.1.0 30M libpython3.13.so.1.0 34M libpython3.14.so.1.0 The static library is likely large because of `--with-optimizations` enabling LTO (so smaller shared libs, but larger static libs).
- t43562 1y agoFor me the "criminal" thing is that Pypy exists on a shoestring and yet delivers the performance and multithreading that others gradually try to add to cpython. It's problem is, IMO, compatibility. Long ago I wanted to run it on yocto but something or other didn't work. I think this problem is gradually disappearing but it could be solved far more rapidly with a bit of money and effort probably.
- dec0dedab0de 1y agoPyPy still has the GIL so the multithreading stuff is the same problem. However, the JIT does make things much faster
- super256 1y agoMissed opportunity for "Pi thon 3.14 is here. How fast is it?"
- fifticon 1y agoI know this is not a highquality comment, but this must be the ideal language to run on a raspberry Pi. I'll see myself out; I also do Bar Mitzwahs.
- sandGorgon 1y agopypy has frequently struggled with funding. Here's a link if you want to donate this christmas https://opencollective.com/pypy https://opencollective.com/pypy
- lunias 1y agoIt remains solidly among the slowest languages you could choose. Consider your use case and the trade-offs wisely.
- OhNoNotAgain_99 1y ago[dead]
- tomas789 1y agoI like the Rust being there. It is a reality check to keep the numbers in perspective. (C, C++ or something like that would work too)
- jimlawruk 1y agoπ-thon is finally here
- alberth 1y agoWhy isn’t Pypy the default recommended runtime? The performance increase seems jaw dropping.
- zoobab 1y agoI have 128 cores on my machine, Python still do not use them all.