Py-spy
lastmod 2025-06-12created 2025-06-122 edits
Sampling profiler for Python programs
Usage
py-spy works from the command line and takes either the PID of the program you want to sample from or the command line of the python program you want to run. py-spy has three subcommands record, top and dump:
record
py-spy supports recording profiles to a file using the record command. For example, you can generate a flame graph of your python process by going:
See also
Favorite site
- Github - benfred/py-spy
- (Python profiling) Analyzing Python code performance with py-spy and yappi — Kkeujeok-kkeujeok Coding Gongbang
Pages that link here