profiling — Python profilers — Python 3.16.0a0 documentation

docs.python.org

Tin mới

pdb — The Python Debugger

profiling.tracing — Deterministic profiler

Python Module Index

3.16.0a0 Documentation

The Python Standard Library

Debugging and profiling

profiling.sampling

A statistical profiler that periodically samples the call stack. Run scripts directly or attach to running processes by PID. Provides multiple output formats (flame graphs, heatmaps, Firefox Profiler), GIL analysis, GC t

timeit: Measure the execution time of small code snippets.

The profiler modules are designed to provide an execution profile for a given program, not for benchmarking purposes. For benchmarking, use the timeit module, which provides reasonably accurate timing measurements. This

pstats.Stats.print_callers

Which functions called a given function (callers) and which functions it called (callees). Flame graphs visualize this as nested rectangles; pstats can display it via the print_callers() and print_callees() methods.

profile: Pure Python profiler (deprecated). (deprecated)

Deprecated since version 3.15: The pure Python profile module is deprecated and will be removed in Python 3.17. Use profiling.tracing (or its alias cProfile) instead. See profile for migration guidance.