Hacker News new | ask | show | jobs
by v3ss0n 867 days ago
PyPy is one of the most underrated python implementation. It just makes your pure python code 20x faster without needing to change anything ( if you don't have c++. Extension depends) We had used PyPy in production , especially on Real-time/ asynchronous web apis that doesn't need machine learning stack
3 comments

When I wrote asset processing script for a video game in Python, the initial run time was 14 minutes, I was not happy with it because it made the CI times long as hell, so my next step was to rewrite it in C++ and try to sprinkle it with some SIMD magic to speed it up, but out of curiosity, I ran it through PyPy - that brought down the run time from 14 minutes to just 18 seconds (!), needless to say, I was happy enough with the result that I figured these 18 seconds are good enough to not make me waste my time with rewriting the entire tool.
News like this needs to promote. They asked user's to post that on their blog. Can you help posting it?
If Python community and CPython developers were more open to PyPy, many things could be changed. A group of people talks about how good having a third-party interpreter in Python community while the whole Python eco-system is heavily relying on the old (maybe good-enough) Python C API.

Whenever I meet a C API issue on RustPython project (yes, I contribute to RustPython), I think about PyPy, and check what's going on C API, and realize 15 years was not enough to change things. Now the momentum of PyPy is not that strong as before. I believe Python community lost a huge chance.

Hope HPy or something can save PyPy. Maybe RustPython also will get a chance around there.

Core contributors still contributing regularly. Problem of PyPy was making decisions that's really bad for exposure - like having non GitHub repo because they love mercurial. I love mercurial too but to contribute to opensource have to use GitHub. Which they finally moved now. I hope PyPy will become popular again.
CPython is finally getting a JIT, although this change in mindset was mostly due to Microsoft and Meta.

So much time lost by not embracing PyPy.

Absolutely

It is really underrated.

Maybe it's the extension issue, maybe it's something else or maybe it's the fact that it was born as an experimental platform more than anything

But it should have been more popular

Python's use base is now dominated by ML and scientific in general isn't it? Both of those communities are relying on extensions completely. I am quite possibly biased as I haven't written any python that didn't use at least numpy.
> Python's use base is now dominated by ML and scientific in general isn't it?

No?

Python may dominate those fields vs other languages, but those fields don't dominate Python use, in my experience.

If you do a job search for "Django", "flask" or "fastapi" you'll see that there are a lot of web dev jobs using it.
I still use Python for scripting simple things and for writing web services. I use fastapi for simple things, but I will use Django for anything that needs a database because it has the best migration tooling that I have used.
I guess I could have stated my bias up front as well: mostly a scientific user/dev here. I did enable pypy wheel builds for a pybind11 project and have things magically work, and I've had 'pypy-days' to see if there was any breaking for me (none so far, so kudos!), but other than that never actually used it/found uses for it.
Pypy supports numpy just fine.
Not really? It is hideously slow. They say that will get fixed when numpy finishes getting ported to the HPy interface, but for now my stuff runs faster in cpython. I could try using numpypy but they have deprecated it.
Ah, I was thinking about compatibility. Didn’t realize the performance was that bad? Thanks for the warning.
Well, PyPy was not really accepted by Guido and the PSF people. When we ask questions about PyPy to PSF people, they give unfavorable answers but some of those shows they didn't try much at all. So I don't know what kind of drama they have.