After assessing the execution time of the program we are ready to identify the parts of the code that need performance tuning. Those parts are typically quite small, compared to the size of the program.
Historically, there are three different profiling modules in Python's standard library:
profilemodule: This module is written in pure Python and adds a significant overhead to the program execution. Its presence in the standard library is due mainly to its extendibility.
hotshotmodule: A C module designed to minimize the profiling overhead. Its use is not recommended by the Python community and it is not available in Python 3.
cProfilemodule: The main profiling module, with an interface similar to