5 ms·
Unfortunately, phytran is missing in the comparison. Phytran works in a lot of cases and it easy to use by just using python types. I would like to see a compar
by tomthe 4y ago
Unfortunately, phytran is missing in the comparison. Phytran works in a lot of cases and it easy to use by just using python types. I would like to see a comparison with taichi, as taichi also seems to be interesting.
- mkl 4y agoI'm pretty sure you mean Pythran. That's been disappointing in my experiments with it. Nuitka is another one that's missing.
- cycomanic 4y agoWhat do you mean disappointing? I have consistently been getting the best results with pythran. That said it is strongly focused on numerical code, so your milage might vary for other code. You also should add compiler optimisation flags to get the best performance. Regarding Nutika AFAIK its goal is not a speed up and performance gains are pretty modest in most cases.
- mkl 4y agoMaybe I didn't have appropriate compiler flags. I didn't devote much time to it, as it didn't seem promising from my initial attempts and I found it easier to get faster performance with other methods (see reply to sibling comment). This was integer numerical code filling in a 2D array with lots of individual comparisons and backtracking (no whole-array operations). Terrible for plain Python, but Cython and C ate it up.
- tomthe 4y agoYes, I mean Pythran ( https://github.com/serge-sans-paille/pythran https://github.com/serge-sans-paille/pythran ). Thank you. Was Nuitka better? Pythran is quite simple to install and use in Jupyter.
- mkl 4y agoFor the most recent application I tried Pythran on, significantly annotated Cython was the winner (compared to plain Python, Numba, Pythran, and more readable Cython). Plain Python was the slowest, and Pythran was much slower than the others. I didn't try Nuitka for it. I ended up rewriting the key code in C anyway, which was faster still. This was integer numerical code filling in a 2D array with lots of comparisons and backtracking.
- dagw 4y agoPythran and Nuitka have very different philosophies and goals. Pythran aims for performance first, and to achieve that it is willing to sacrifice a lot of compatibility and supports only a small subset of python. Taking a random piece of python code and trying to run it under pythran will almost certainly fail. To get the most out of Pythran you really have to write 'pythran' code rather than 'python' code. Nuitka aims for 100% compatibility first. If you have some random python code that works under CPython, but not Nuitka, then that is a bug that will be fixed. To achieve this compatibility there are a lot of optimisations that cannot be done. If you have code that works under both Nuitka and Pythran then it will almost certainly be faster in Pythran.