3 ms·
As the author of the original version, I'm very glad to see such an improvement ! My IPython Cookbook contains increasingly optimized versions with Cython as a
by rossant 9y ago
As the author of the original version, I'm very glad to see such an improvement !
My IPython Cookbook contains increasingly optimized versions with Cython as an illustration of how to use this library to accelerate Python code. The fastest Cython version is 300x faster than pure Python ; a lot of Python/NumPy overhead is bypassed by reimplementing the logic in, basically, C. The OpenMP multicore GIL-releasing version is roughly 4x faster than the fastest Cython version on a quadcore computer. (https://github.com/ipython-books/cookbook-code/tree/master/notebooks/chapter05_hpc https://github.com/ipython-books/cookbook-code/tree/master/n...)
There is also a GPU reimplementation (in OpenGL/GLSL) in the VisPy examples (https://github.com/vispy/vispy/blob/master/examples/demo/gloo/raytracing.py https://github.com/vispy/vispy/blob/master/examples/demo/glo...), it is animated and runs in real time.