3 ms·
Here is a nice comparison https://flothesof.github.io/optimizing-python-code-numpy-cython-pythran-numba.html https://flothesof.github.io/optimizing-python-code-
by mattip 7y ago
Here is a nice comparison https://flothesof.github.io/optimizing-python-code-numpy-cython-pythran-numba.html https://flothesof.github.io/optimizing-python-code-numpy-cyt...
Tl;dr: pythran is very similar to numba but blazingly fast on cpu
- mlthoughts2018 7y agoThe Cython example in that link is actually not a fair comparison, since it still forces the numpy ndarray type in the signature. Instead it should use typed memoryviews [0], which are faster and can avoid more cases that will rely on the GIL accidentally (such as when an ndarray has to be treated as a Python object). [0]: https://cython.readthedocs.io/en/latest/src/userguide/memoryviews.html https://cython.readthedocs.io/en/latest/src/userguide/memory...