Summary

To sum things up, we've seen two major profilers used with Python: cProfile, which comes bundled with the language, and line_profiler, which gives us the chance to look at each line of code independently. We also covered some examples of analysis and optimization using them.

In the next chapter, we will look at a set of visual tools that will help us in our job by displaying the same data we covered in this chapter, but in a graphic manner.

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.