April 2019
Intermediate to advanced
646 pages
16h 48m
English
Macro-profiling is done by running the application in a special mode, where the interpreter is instrumented to collect statistics on the code usage. Python provides several tools for this, including the following:
The recommended choice for most Python programmers is cProfile due to its reduced overhead. Anyway, if you need to extend the profiler in some way, then profile will be a better choice because it doesn't use C extensions and so is easier to extend.
Both tools have the same interface and usage, so we will use only one of them here. The following is ...