Tools Practical By Samson Tanimawo, PhD Published Oct 19, 2025 4 min read

py-spy for Python Performance

py-spy is a sampling profiler for Python.

Usage

py-spy top --pid PID shows hot functions live.

py-spy record for FlameGraph data.

When

Slow Python process; identify the hot path.

Low overhead; safe in production.

Alternatives

cProfile is built-in but heavier.

py-spy beats it for production debugging.