3 ms·
> The only issue with Python is speed, but if you use Numpy properly, even that isn't a big issue. Numpy leaves a couple of orders of magnitude of performance
by krastanov 6y ago
> The only issue with Python is speed, but if you use Numpy properly, even that isn't a big issue.
Numpy leaves a couple of orders of magnitude of performance on the table, especially if you use small arrays and a lot of intermediary computation. It is terrible in terms of memory allocation overhead. Cython or @tensorflow.function fix much of that, but then you are not really using python anymore.
> They often don't make use of that out of a sense of pride and not invented here.
This is a lazy and rather hurtful accusation.
- montalbano 6y agoAgree, but to add, there are many transcendental functions (e.g. I needed to use the Mittag-Leffler function many times in my work) which are near-impossible to implement in Numpy in a way that gives anywhere near usable performance. It's not a common enough function to be pre-implemented in Scipy special functions. In my case, I wrote the algorithm in Numpy/python myself which was almost unusably slow. I then outsourced it to a precompiled fortran program. Finally I just switched to Julia. There was already a library, MittagLeffler.jl which did everything I needed and was written in pure Julia. In the end everything was much faster than the Python/Fortran frankenstein code I had. Edit: For more info on Julia and difficult (computationally) mathematical functions see: https://youtu.be/mSgXWpvQEHE?t=1262 https://youtu.be/mSgXWpvQEHE?t=1262
- krastanov 6y agoAnd, unlike in many other languages, that MittagLeffler julia function can probably already work efficiently on special arrays (distributed arrays, GPU arrays, etc), is fussable into inner loop kernels, and supports automatic differentiation, without extra work from the author of the package.