September 2026
1051 pages
35h 4m
English
Optimizing a program can take a lot of time. As a rule, the first step is to create an executable program that meets all the needed requirements, but doesn’t yet necessarily place greater value on the optimization of the algorithm. This is mainly due to the fact that the actual bottlenecks are often only recognized when the program is finished, which means that a lot of time might have been invested in optimizing noncritical sections at an early stage.
To capture the runtime behavior of a Python program as accurately as possible, the timeit, cProfile, and trace modules are part of the standard library of Python. These modules will be described in the following sections.
Read now
Unlock full access