5 ms·
The one thing I hope for when it comes to Python is that PyPy becomes the default runtime everywhere. CPython is so unbelievably slow when compared to language
by TekMol 5y ago
The one thing I hope for when it comes to Python is that PyPy becomes the default runtime everywhere.
CPython is so unbelievably slow when compared to languages like PHP and Javascript.
When using PyPy, I keep encountering road bumps because many tools are still expecting that one uses CPython.
Dear world - please accelerate the conversion to PyPy!
- treesciencebot 5y agoAuthor of this project here (and also a CPython core developer FWIW), for many aspects (including the AST) PyPy follows CPython closely even on implementation details so `refactor` would probably work out of the box once PyPy releases 3.9 (the latest stable version for PyPy is 3.7, and 3.8 is on the way!).
- keithasaurus 5y agoI think it's more likely that people start using mypyc for performance-critical code. https://mypyc.readthedocs.io/en/latest/ https://mypyc.readthedocs.io/en/latest/
- formerly_proven 5y agoI assume the performance profile is similar to compiling regular Python code with Cython (which it can do). There is a decent but not world-changing speed-up; this makes sense, because pretty much the only thing you are removing from the equation is the instruction and stack overhead of the interpreter, you still have to perform all the equivalent work that CPython does, otherwise you would end up with different semantics. And this work is substantial. In contrast, a tracing JIT can dynamically elide most of this work without changing the semantics.
- xapata 5y agoAfter switching to Cython, you can add Cython syntax, like type definitions, to gain big speed improvements.
- rattray 5y agoWow, this looks exciting. Looks like Cython without any extra work/syntax, for those using mypy. I wish their readme gave some kind of estimate of how the speedups might compare to Cython and PyPy. But it's currently alpha, so there may be big differences by the time it's ready for production use. Similar approach to the Sorbet Compiler for Ruby (albeit targeting C instead of llvm... I wonder how that might impact optimizability).
- heavyset_go 5y agoProjects that depend on CPython C extensions should consider migrating to HPy[1] for C extension compatibility across Python implementations. [1] https://github.com/hpyproject/hpy https://github.com/hpyproject/hpy
- sitkack 5y agoThis looks interesting, but it also looks ambitious and not anywhere ready. Everyone would be well served for extensions to not be aware of Python internals and expose a clean handle based api to all users. For this, cffi is sufficient and already available across nearly all Python implementations. https://cffi.readthedocs.io/en/latest/ https://cffi.readthedocs.io/en/latest/ I do agree that a standardized Python should have an object model that is a clean public contract, but given that Python is CPython and there is no standardization, that the library runtime is married to the core also makes this incredibly difficult politically.
- hsbauauvhabzb 5y agois performance even an issue either the tool? I regularly see people complain about python speed but normally find it’s algorithmic as opposed to interpreter imposed..