# benfred/py-spy

Sampling profiler for Python programs

Repository: https://github.com/benfred/py-spy
Canonical: https://ross.abutalabs.com/products/py-spy
Language: Rust
License: MIT
License Family: permissive
Topics: profiler, python, performance-analysis, profiling
Last push: 2026-08-14T01:33:58+00:00

## Health v2 (maintenance only)
Score: 81/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 97, release rhythm 49, longevity 100
- inputs: {"age_days": 2955, "days_push": 20, "days_rel": 131, "gap_med": 269.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 15445, forks 541 (observed 2026-08-28T04:11:09.841806+00:00)

## What it is
py-spy is a sampling profiler for Python programs written in Rust. It visualizes where a running Python process spends time without restarting it or modifying code, making it safe for production use.

## Use cases
- profile a running python process without restarting it
- generate flame graphs of python program execution
- find which functions are slow in production python code
- view live top functions consuming CPU in a python app
- dump stack traces of a hung python process
- profile python code with native C extensions

## When to choose
- you need low-overhead profiling of live or production Python processes
- you want flame graphs or speedscope profiles without code changes
- you need to diagnose hangs or CPU hotspots in CPython 2.3-3.14

## When to avoid
- you need deterministic line-by-line tracing or memory profiling
- you profile non-CPython interpreters like PyPy or Jython
- you need an in-process API for programmatic profiling

## Facets
- artifact type: cli-tool
- maturity: stable
- function: benchmarking, monitoring, developer-tools, cli
- domain: developer-tools, performance
- platform: windows, cli, rust, python
- tags: profiler, sampling-profiler, flame-graph, python-profiling, production-debugging, command-line, linux, macos

## Member repositories
- benfred/py-spy (main) score 81

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:09.841806+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:05:51.386494+00:00, confidence not recorded.
  - readme: https://github.com/benfred/py-spy (fetched 2026-08-28T04:11:09.841806+00:00, sha e6e2a552dd19)
  - registry_crates: https://crates.io/api/v1/crates/py-spy (fetched 2026-08-29T08:03:59.651514+00:00, sha aa99e3c06b95)
- Data as of 2026-08-30T08:39:29.467469+00:00.
