pypynuitka

PyPy vs. Nuitka


During the last days, I was toying around with Nuitka, a tool that compiles Python into executable C/C++ programs.

I have not found any speed advantage of Nuitka (compared to PyPy). What is the meaning of Nuitka, then? Am I missing something?


Solution

  • Nuitka and PyPy have very different goals.

    Nuitka does Ahead Of Time (AOT) compilation of your python project to C, using the python C-API. In this way it is more similar to Cython. It is still a young project, but impressively has achieved full compatibility with the enormous python language spec. The next step will be to enable optimizations in the compiler process, much like gcc -O3. Note that Nuitka is used to transform your python code into an executable. You then "ship" the executable, with some level of obscifucation of the original python code.

    PyPy does Just In Time (JIT) compilation of running code to assembly. It traces your running code, identifies hot spots, and produces faster versions of the hot sections of your program. It too, has full compatibility with the python language spec. It does not transform your python code ahead of time, so you "ship" your python code as the final product.

    I expect both projects will continue to improve speed of execution, but they target very different needs.