Debugging and ProfilingΒΆ
These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed breakdown of execution times, allowing you to identify bottlenecks in your programs. Auditing events provide visibility into runtime behaviors that would otherwise require intrusive debugging or patching.
- Audit events table
bdb
β Debugger frameworkfaulthandler
β Dump the Python tracebackpdb
β The Python Debugger- The Python Profilers
- Introduction to the profilers
- What Is Statistical Profiling?
- Instant Userβs Manual
- Statistical Profiler Command Line Interface
profiling.sampling
Module Reference- Deterministic Profiler Command Line Interface
profile
andcProfile
Module Reference- The
Stats
Class - What Is Deterministic Profiling?
- Limitations
- Calibration
- Using a custom timer
timeit
β Measure execution time of small code snippetstrace
β Trace or track Python statement executiontracemalloc
β Trace memory allocations