commands.sh

py-spy

all

A sampling profiler for Python programs.

More info →

Options (2)

-p, --pidboolean

Show a live view of the functions that take the most execution time of a running process

Example: py-spy top {{[-p|--pid]}} {{pid}}
-o, --outputboolean

Produce an SVG flame graph of the function call execution time

Example: py-spy record {{[-o|--output]}} {{path/to/profile.svg}} {{[-p|--pid]}} {{pid}}

Examples (4)

Show a live view of the functions that take the most execution time of a running process

py-spy top [-p|--pid] pid

Start a program and show a live view of the functions that take the most execution time

py-spy top -- python path/to/file.py

Produce an SVG flame graph of the function call execution time

py-spy record [-o|--output] path/to/profile.svg [-p|--pid] pid

Dump the call stack of a running process

py-spy dump [-p|--pid] pid
made by @shridhargupta | data from tldr-pages