4 ms·
Your question has been asked here [1]. I never used Numba myself but assume from the discussion that it is difficult/impossible to bring user objects into Numba
by chappi42 9y ago
Your question has been asked here [1]. I never used Numba myself but assume from the discussion that it is difficult/impossible to bring user objects into Numba and that due to the extremely rich Python object model one can only make Python fast for a small subset of the language.
Example: in Julia I can easily define my own primitive type, let's say a ModInteger (an old video is here [2]) and it will be as fast as a normal "built in" integer in a for loop (and benefit from possible speedups: simd, parallelization, cuda, GPU - but don't have (much) experience in this area).
Likely such a ModInteger couldn't be as easily integrated in Numba?
[1]: https://discourse.julialang.org/t/julia-motivation-why-werent-numpy-scipy-numba-good-enough/2236 https://discourse.julialang.org/t/julia-motivation-why-weren...
[2]: (2013) https://www.youtube.com/watch?v=rUczbQ6ZPd8 https://www.youtube.com/watch?v=rUczbQ6ZPd8 (at ~37:00 mins)
- marmaduke 9y agoYep I was expecting you might mention user defined types. Numba supports them but with an object model which is more sympathetic to acceleration. The other place where Julia might see better speed is when you have an optimization algorithm and the objective function both written in Julia, which allows for optimization across functions, whereas in Python you could write a fast objective function with Numba but couldn't optimize across function call with the optimizer written in Fortran.