4 ms·
But how does it compare to PyPy?
by bhouston 12y ago
But how does it compare to PyPy?
- jarcane 12y agoTo be honest, I found that in my use case (game dev, supported by bindings to a C library), PyPy was actually slower than CPython. I'd be curious to dig up my code and compare performance to a Nuitka-compiled executable.
- detaro 12y agoout of curiosity, which bindings did you use?
- jarcane 12y agolibtcod. It was a roguelike.
- ptx 12y agoThose Python bindings seem to use ctypes, which is indeed slower[1] on PyPy. They recommend[2] using cffi instead. [1] http://pypy.org/performance.html http://pypy.org/performance.html [2] http://pypy.readthedocs.org/en/latest/extending.html http://pypy.readthedocs.org/en/latest/extending.html
- illumen 12y agoFor games, other soft realtime, and run once code, pypy is slower. The newer GC is better, but the JIT still causes pauses. The slow warm up of the jit, no type hint saving, and slower interpreter is why it is not good on run once code. Of course if your python extensions are calling optimized assembly routines, or hardware, then it will be faster than pypy code written in python. Also, using a JIT is not possible on some platforms (iOS, or if the CPU architecture isn't supported by pypy). Not to say that pypy isn't better for certain tasks of course.
- bhouston 12y agoThe solution is easy then, PyPy should have an AOT compilation option, like ART does.
- jfeser 12y agoThat's pretty much what Nuitka is. Unfortunately, PyPy is only fast because it can take advantage of runtime information in the JIT. AOT compilation loses that advantage.
- ris 12y agoNot easy at all. ART generally compiles quite static languages (Java). Python is an incredibly dynamic language. The challenges for AOT compilation are vastly different.