Summary

In this chapter, we have covered two alternatives to the standard Python implementation. One is PyPy, which consists of a version of Python and is implemented in RPython. It has a JIT compiler in charge of optimizing the code during execution time. The other one is Cython, which is basically a transpiler of Python code into C code. We saw how each of them worked, how to install them, and how our code needed to be changed in order to gain benefits from using them.

Finally, we went over a few points on how and when to choose one over the other.

In the next chapter, we'll focus on a very specific use case for Python: number crunching. The topic is very common in the Python community, since the language is very often used for scientific purposes. ...

Get Mastering Python High Performance 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.