Live data from Hacker News

Python 3.14 is here. How fast is it?

blog.miguelgrinberg.com

361–370 of 579 posts

Re: Python 3.14 is here. How fast is it?

#361
post #343

More 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…

> Are there any serious technical reasons not to do it?

Yes.

First is startup time. REPL cycle being fast is a big advantage for development. From a business perspective, dev time is more expensive then compute time by orders of magnitude. Every time you make a change, you have to recompile the program. Meanwhile with regular python, you can literally develop during execution.

Second is compatibility. Numpy and pytorch are ever evolving, and those are written a C extensions.

Third is LLMs. If you really want speed, Gemma27bqat that runs on a single 3090 can translate python codebase into C/C++ pretty easily. No need to have any additional execution layer. My friend at Amazon pretty much writes Java code this way - prototypes a bunch of stuff in Python, and then has an LLM write the java code thats compatible with existing intra-amazon java templates.

Re: Python 3.14 is here. How fast is it?

#362
post #74

Earlier quoted context omitted.

Because 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.

This might have been your experience, but mine has been very different. In my experience a typical python workload is 50% importing python libraries, 45% slow python wrapper logic and 5% fast native code. I spend a lot of time rewriting the python logic in C++, which makes it 100x faster, so the resulting performance approaches "10% fast native logic, 90% useless python imports".

If imports are slow, you need to not be writing python in the first place, because you are either on limited hardware or you are writing a very performant app.

Re: Python 3.14 is here. How fast is it?

#363

What are the reasons why nobody uses pypy?

I think generally people who care about performance don't tend to write their code in Python to begin with, so the culture of python is much less performance sensitive than is typical even among other interpreted languages like perl, php, ruby or javascript. The people who do need performance, but are still using python, tend to rely on native libraries doing significant numerical calculations, and many of these libraries are not compatible with PyPy. The escape hatch there is to offload more and more of the computation into the native runtime rather than to optimize the python performance.

Re: Python 3.14 is here. How fast is it?

#365

I 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.

Why?

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

Re: Python 3.14 is here. How fast is it?

#366

Earlier quoted context omitted.

> flask Off-topic, but I absolutely loathe new Flask logo. Old one[0] has this vintage, crafty feel. And the new one[1] looks like it was made by a starving high schooler experimenting with WordArt. [0] - https://upload.wikimedia.org/wikipedia/commons/3/3c/Flask_lo... [1] - https://flask.palletsprojects.com/en/stable/_images/flask-na...

I was unaware of the new logo… and I am just realizing for the first time after many many Flask apps… that the logo is not a chili pepper.

I feel dumb - I thought it was a chili pepper, too.

Re: Python 3.14 is here. How fast is it?

#367
post #308

Earlier quoted context omitted.

It'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.

because of Django admin? any downsides/notable warnings for people considering Flask v Django? any migration guide that's helpful?

Go with what you understand easier. No downsides to making an app in either, other than the logo.

Re: Python 3.14 is here. How fast is it?

#368

Earlier quoted context omitted.

because it turns out that optimizing performance of a programming language designed for use-cases where runtime performance doesn't matter ... doesn't matter

There's currently talk of adding gigawatts of data center capacity to the grid just for use cases where python dominates development. While a lot of that will be compiled into optimized kernels on CPU or GPU, it only takes a little bit of 1000x slower code to add up to a significant chunk of processing time at training or inference time.

What percentage of the CPU cycles are actually spent running Python though? My impression is _very_ low in production LLM workloads. I think significantly less than 1%. There are almost certainly better places to spend the effort, and if it did matter, I think they would replace Python with something like C++ or Rust.

Re: Python 3.14 is here. How fast is it?

#369

Earlier quoted context omitted.

That's because you're doing web stuff. (I/O limited). So much of our computing experience has been degraded due to this mindset applied more broadly. Despite a steady improvement in hardware, my computing experiences have been stagnating and degraded in terms of latency, responsiveness etc. I'm not going to even go into the comp chem simulations I've been running, or that about 1/3 the stuff I do is embedded. I do st…

As a java backend dev mainly working on web services, I wanted to like python, but I have found it really hard to work on a large python project because the auto complete just does not work as well as something like java. Maybe it is just due to not being as familiar with how to properly setup a python project, but every time I have had to do something in a django or fast api project it is a mess of missing types. Ho…

Pycharm has been fine. Just disable the AI stuff and you get accurate completion. It even has completion for Django ORM stuff, which is heavily dynamic.

Re: Python 3.14 is here. How fast is it?

#370

Earlier quoted context omitted.

> pypy which is already much faster It isn't.

I 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.

> when it works

This is the problem!

Post reply on HN