Profiling your Numba code

If you’re writing numeric Python code, Numba can be a great way to speed up your program.
By compiling a subset of Python to machine code, Numba lets you write for loops and other constructs that would be too slow in normal Python.
In other words, it’s similar to Cython, C, or Rust, in that it lets you write compiled extensions for Python.

Numba code isn’t always as fast as it could be, however.
This is where profiling is useful: it can find at least some of the bottlenecks in your code.

In this article we’ll cover:

  • Profila, a new profiler I’ve released that is specifically designed for Numba code.
  • The limits of profiling.
    There are many potential performance enhancements that a profiler can’t and won’t help

     

     

     

    To finish reading, please visit source site