From the course: Faster Python Code

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Numba

Numba - Python Tutorial

From the course: Faster Python Code

Start my 1-month free trial

Numba

- Python is a dynamic interpreted language. This gives us a lot of power and flexibility. Going from zero to working in Python is very fast. However, being that dynamic means it's hard to do optimization at the language level. Languages that have type information, from C, C++, to Haskell, can use this information to gain a lot of performance. However, not all is lost. A technology called JIT, Just-In-Time compiling, has been used very successfully in several dynamic languages to gain performance. The idea behind Just-In-Time is that we collect information on the code at run time and according to this information, we generate specific machine code for these cases. In certain scenarios, JIT compiler can know more than a traditional compiler and make better decisions about optimization. This also means that if you're function runs only once, JIT will not help. But in most cases, bottlenecks are in functions that are called many times. Cpython does not come with a JIT, but does an…

Contents