Introduction
The previous chapter presented techniques for code optimization. Sometimes, these methods are not sufficient, and we need to resort to advanced high-performance computing techniques.
In this chapter, we will see three broad, but not mutually exclusive, categories of methods:
- Just-In-Time (JIT) compilation of Python code
- Resorting to a lower-level language, such as C, from Python
- Dispatching tasks across multiple computing units using parallel computing
With JIT compilation, Python code is dynamically compiled into a lower-level language. Compilation occurs at runtime rather than ahead of execution. The translated code runs faster since it is compiled rather than interpreted. JIT compilation is a popular technique as it can lead to fast and high-level languages, whereas these two characteristics used to be mutually exclusive in general.
JIT compilation techniques are implemented in packages such as Numba or NumExpr, which we will cover in this chapter.
We will also use Julia, a programming...