About this project

py-spy is a sampling profiler written in Rust designed to analyze Python programs with extremely low overhead. Because it runs in a separate process and reads the target program's memory directly, it is safe for use in production environments. Key capabilities include: - **Non-intrusive Profiling**: Visualize time spent in functions without restarting the program or modifying source code. - **Three Primary Modes**: - `record`: Generates profiles in formats such as interactive SVG flame graphs or speedscope files. - `top`: Provides a live, high-level view of the functions consuming the most time, similar to the Unix top command. - `dump`: Dumps the current call stack for each Python thread, including optional local variables. - **Broad Compatibility**: Supports Linux, OSX, Windows, and FreeBSD, and is compatible with CPython versions 2.3-2.7 and 3.3-3.14. - **Advanced Features**: - Support for profiling native C/C++ or Cython extensions. - Ability to profile subprocesses (e.g., multiprocessing or gunicorn worker pools). - GIL (Global Interpreter Lock) detection to filter for threads holding the lock. - Non-blocking mode to avoid pausing the target process entirely.