py-spy
A sampling profiler for Python programs written in Rust.
- Status
- Generally available
- Last checked
- Aging · Sep 2, 2026
- License
- Open source
- Pricing
- Free tier · from $0
What it is
Py-Spy is a low-overhead sampling profiler that helps developers understand the performance characteristics of their Python applications. It provides insights into where time is being spent, making it easier to optimize and debug code.
Py-Spy stands out for its low-overhead and ability to attach to running processes without restarting them, making it ideal for production environments where minimal disruption is critical.
When it fits — and when it doesn’t
A good fit for
Developers who need to optimize the performance of their Python applications without significant overhead.
Teams working in production environments where profiling must be non-intrusive.
Individuals or teams looking for a tool that can attach to running processes and provide real-time insights.
Look elsewhere if
Projects requiring detailed line-by-line analysis as py-spy is a sampling profiler.
Applications written in languages other than Python, as it only supports profiling Python programs.
Known weaknesses
Each one links to the public issue, changelog or docs page it came from, where we have one.
- 01
Limited support for multi-threaded applications
Py-Spy may not accurately profile Python programs that heavily utilize threading or multiprocessing, leading to incomplete performance data.
- 02
Complex setup and configuration for non-standard environments
Setting up Py-Spy in complex containerized or virtualized environments can be challenging due to limited documentation on advanced configurations.
- 03
Performance overhead when profiling I/O-bound applications
Py-Spy's sampling profiler may introduce some performance overhead when used with IO-bound Python applications, which could skew the results slightly.
What it does well
Low-overhead sampling profiler for Python programs.
Visualizes CPU usage and flame graphs.
Can attach to running processes without restarting them.
Pricing
- Free tier
- YesOpen source — free to use
- Paid from
- $0
- Model
- Flat rate
- Enterprise plan
- No
Pricing not independently confirmed — check the vendor’s page.
Performance benchmarks
How Fast Is It?
Set up py-spy
Setup steps, common gotchas and what to check after 30 days.