Faster Python calculations with Numba
For certain types of computation, in particular array-focused code, the Numba library can significantly speed up your code. Sometimes you’ll need to tweak it a bit, sometimes it’ll just work with no changes. And when it works, it’s a very transparent speed fix.
In this article we’ll cover:
- Why using NumPy on its own is sometimes not enough.
- The basics of using Numba.
- How Numba works, at a high-level, and the difference that makes to how your code runs.
Source: Faster Python calculations with Numba: 2 lines of code, 13× speed-up, an article by Itamar Turner-Trauring.