py-spy

Sampling profiler for Python programs with minimal overhead

brewmacoslinux
Try with needOr install directly
Source

About

Sampling profiler for Python programs

Commands

py-spy

Examples

Profile a running Python process by PID$ py-spy record -o profile.svg --pid 12345
Profile a Python script and generate a flame graph$ py-spy record -o profile.svg -- python script.py
Dump the call stack of a running Python process$ py-spy dump --pid 12345