Chapter 12. Performance – Tracking and Reducing Your Memory and CPU Usage

Before we talk about performance, there is a quote by Donald Knuth you need to consider first:

"The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming."

Note

Donald Knuth is often called the father of algorithm analysis. His book series, The Art of Computer Programming, can be considered the Bible of all fundamental algorithms.

As long as you pick the correct data structures with the right algorithms, performance should not be something to worry about. That does not mean you should ignore performance entirely, ...

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