{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing"},{"label":"Debuggers","url":"https://skillfed.io/packages/category/software-development-debuggers"}],"enrichment":{"capability":"Pyinstrument is a statistical call-stack profiler that samples your Python program's execution to identify which functions consume the most time, helping you find and optimize performance bottlenecks.","skillfed_tags":["profiling","performance-analysis","debugging"],"use_cases":["Profile a web application request to find which handler or middleware is causing latency.","Identify the slowest function in a data-processing pipeline before optimizing it.","Profile a Jupyter notebook cell to understand where computation time is spent during analysis.","Integrate profiling into a Django or FastAPI application to capture production performance issues.","Use the decorator API to profile individual functions or methods without modifying surrounding code.","Export HTML reports to share performance analysis with team members or stakeholders."],"what_it_does":"Pyinstrument is a statistical profiler that periodically samples your Python program's call stack to measure where time is spent. Unlike deterministic profilers that instrument every function call, pyinstrument uses sampling to keep overhead low while still identifying the slowest parts of your code. It supports multiple output formats: a hierarchical text tree view for the terminal, an interactive HTML report with timeline and call-stack navigation, and integration with Jupyter notebooks via a magic command.\n\nThe package is designed for developers who need to optimize slow Python code but want a tool that's easy to use and doesn't require extensive instrumentation. It works with modern Python versions (3.8+) and includes integrations for Django, FastAPI, Litestar, and aiohttp. Recent versions added a context-manager and decorator API for profiling specific code blocks, plus lower-overhead timing options for environments like Docker where syscall-based timers are slow.","worth_installing":"Yes. Pyinstrument is actively maintained, has no known vulnerabilities, carries a permissive license, and solves a real problem\u2014finding performance bottlenecks\u2014with a low-friction install and intuitive API. The medium install friction is offset by broad platform coverage and the value of its output formats. Recommended for any Python developer doing performance optimization."},"id":"pyinstrument","links":{"html":"https://skillfed.io/packages/pyinstrument","md":"https://skillfed.io/packages/pyinstrument.md","pypi":"https://pypi.org/project/pyinstrument/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-29","license_spdx":null,"license_treatment":"permissive","name":"pyinstrument","python_support":"supports_current","summary":"Call stack profiler for Python. Shows you why your code is slow!"},"popularity":{"monthly_downloads":10935462,"position":1425,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"5.1.3"}
