py-spy

A sampling profiler for Python programs written in Rust.

EstablishedOpen SourceLow lock-in

Pricing

Free tier

Flat rate

Adoption

Stable

License

Open Source

Data freshness

Aging · Jun 8, 2026

Overview

What is py-spy?

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.

Key differentiator

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.

Capability profile

Capability Radar

Ease of StartEcosystemValueMaturityFlexibilityScale Ready

Honest assessment

Strengths & Weaknesses

↑ Strengths

Low-overhead sampling profiler for Python programs.medium

Visualizes CPU usage and flame graphs.medium

Can attach to running processes without restarting them.medium

↓ Weaknesses

Limited support for multi-threaded applicationshigh

Py-Spy may not accurately profile Python programs that heavily utilize threading or multiprocessing, leading to incomplete performance data.

Complex setup and configuration for non-standard environmentsmedium

Setting up Py-Spy in complex containerized or virtualized environments can be challenging due to limited documentation on advanced configurations.

Performance overhead when profiling I/O-bound applicationslow

Py-Spy's sampling profiler may introduce some performance overhead when used with IO-bound Python applications, which could skew the results slightly.

Fit analysis

Who is it for?

✓ Best 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.

✕ Not a fit for

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.

Cost structure

Pricing

Free Tier

Available

Open source — free to use

Starts at

$0

Model

Flat rate

Enterprise

None

Performance benchmarks

How Fast Is It?

Ecosystem

Relationships

Next step

Get Started with py-spy

Step-by-step setup guide with code examples and common gotchas.

View Setup Guide →