joerick/pyinstrument

🚴 Call stack profiler for Python. Shows you why your code is slow!

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 32 minutes ago
Added to GitGenius on September 8th, 2026
Created on March 13th, 2014
Open Issues & Pull Requests: 30 (+0)
GitHub issues: Enabled
Number of forks: 302
Total Stargazers: 8,009 (+0)
Total Subscribers: 49 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.6 days
Mean response time: 58.0 days
90th percentile: 185.3 days
Tracked items: 51

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 11% of issues opened in the past year have been closed. Three people close 85% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 16
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 809 days
Stale 30+ days: 16
Stale 90+ days: 14

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (8)
  • PRs welcome (2)
  • bug (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Pyinstrument is a call stack profiler for Python that helps developers identify performance bottlenecks by visualizing which parts of their code consume the most execution time.

The tool works by sampling the call stack at regular intervals during program execution, then aggregating and displaying the results to show where time is actually being spent. Rather than instrumenting every function call, which adds overhead, pyinstrument uses statistical sampling to build an accurate picture of execution patterns with minimal performance impact on the profiled code itself.

Pyinstrument suits developers who need to optimize existing Python applications and want a straightforward way to locate slow functions without extensive code modification. It works well for profiling scripts, web applications, and async code. The tool integrates with Django through middleware and supports Jupyter notebooks via a magic command. It is particularly useful when you need to focus optimization efforts on the actual bottlenecks rather than guessing which functions to improve. The README does not compare it to alternative profilers.

The project maintains active development with recent releases addressing specific use cases: Django middleware customization for selective profiling and disk output, Jupyter magic command rendering options, and memory leak fixes in the C extension. The tool has expanded its build coverage to include Python prereleases and alternative implementations. Development activity includes refinements to output precision that adapt to sampling intervals, allowing users to see appropriate levels of detail depending on their profiling granularity.