There's more...

This is just a very small taste of what both libraries can do. For example, Numba can work with NumPy and generate code for GPUs.

Note that the performance comparison will vary from problem to problem. You can find cases on the web where Numba outperformed Cython. Refer to https://jakevdp.github.io/blog/2012/08/24/numba-vs-cython/ for examples.

It should be clear that Numba is less intrusive than Cython because you end up with 100 percent Python code (although you may still have to refactor for performance). Do not over-optimize; find the most critical parts of your code and concentrate your efforts there.

Get Bioinformatics with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.