3 Numba Tricks for Python Runtime Optimization: Compile the Loop, Widen It, Stop Recompiling It
Python loops are slow for a reason that has nothing to do with the loop. Every iteration of a plain Python for loop sends the interpreter back to the same question: what types are these objects, and which operation should I dispatch?