![]() ![]() The sampling rate, filtering to only include threads that hold the GIL, profiling native C extensions, See py-spy record -help for information on other options including changing Speedscope profiles or raw data with the -format parameter. You can change the file format to generate Which will generate an interactive SVG file looking like: Py-spy record -o profile.svg - python myprogram.py Going: py-spy record -o profile.svg -pid 12345 # OR Generate a flame graph of your python process by Py-spy supports recording profiles to a file using the record command. Or the command line of the python program you want to run. Py-spy works from the command line and takes either the PID of the program you want to sample from On Alpine Linux, py-spy is in testing repository andĬan be installed with apk add py-spy -update-cache -repository -allow-untrusted. On Arch Linux, py-spy is in AUR and can be If you're a Rust user, py-spy can also be installed with: cargo install py-spy.Ĭan be installed with brew install py-spy. You can also download prebuilt binaries from the GitHub Releases Prebuilt binary wheels can be installed from PyPI with: pip install py-spy Py-spy works on Linux, OSX, Windows and FreeBSD, and supports profiling all recent versions of the CPython This means py-spy is safe to use against production Python code. In the same process as the profiled Python program. Py-spy is extremely low overhead: it is written in Rust for speed and doesn't run Program is spending time on without restarting the program or modifying the code in any way. Py-spy is a sampling profiler for Python programs. ![]() Py-spy: Sampling profiler for Python programs
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |