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.
Live workflow · 3 working · 1 queuedLive
Signal · gather Working
Decide · pick action Working
Apply · with verify Working
Learn · update playbook Queued
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.