4 ms·
If you can structure your program in such a way that all your inner loops are handled by BLAS/LAPACK/FFTW, then python works great. The sad fact is you can't a
by yummyfajitas 14y ago
If you can structure your program in such a way that all your inner loops are handled by BLAS/LAPACK/FFTW, then python works great.
The sad fact is you can't always do this. Then you are forced to drop down to C/C++/Fortran.
It would be great if you didn't always have to do this.
- pjmlp 14y agoThe scientific community seems to be welcoming Julia open arms, given its performance improvements over Python, if you look at the rate code is being ported to such a young language.
- travisoliphant 14y agoThis is exactly what Numba is designed to help with. And it already works extremely well for such cases. Numba lets you have ease of use (un-typed containers) and speed (with typed-containers) in the same run-time and the same syntax. Here is are some IPython notebooks which illustrate: https://www.wakari.io/nb/travis/Using_Numba https://www.wakari.io/nb/travis/Using_Numba https://www.wakari.io/nb/travis/numba https://www.wakari.io/nb/travis/numba And the slides from PyCon Talk: https://speakerdeck.com/pyconslides/numba-a-dynamic-python-compiler-for-science-by-travis-e-oliphant-jon-riehl-mark-florisson-and-siu-kwan-lam https://speakerdeck.com/pyconslides/numba-a-dynamic-python-c...
- yummyfajitas 14y agoNumba is great for numerical expressions, but I'd be surprised if it works for trickier bits. For example, consider the problem here: http://arxiv.org/abs/0903.1817 http://arxiv.org/abs/0903.1817 Ultimately I needed to run a math formula on some surfels and connect an edge in a graph if the formula came out True. Following that I had to prune a bunch of edges in the graph. In 2009 (when I did it), I had to drop down to c++. (Admittedly, this was also partly due to a lack of a good python graph lib.) I'd be very surprised if Numba is helpful with something like that - the branching and complex data structures don't seem like a great fit for it.