yappi
Yet Another Python Profiler
What it is and what it does
Yappi is a tracing profiler written in C that measures both CPU time and wall-clock time in Python programs. Unlike the standard library's cProfile, it is designed from the ground up to handle multithreaded applications, asyncio coroutines, and gevent greenlets, allowing you to start, stop, and retrieve profiling results at any point from any thread. It reports statistics per function and per thread, and can export results in callgrind or pstat formats for analysis in external tools.
You use yappi by calling start() before your code runs, then calling get_func_stats() or get_thread_stats() to retrieve results. It supports filtering and sorting by module, function name, or custom callbacks, making it practical for identifying bottlenecks in complex concurrent applications where standard profilers either fail or produce misleading timings.
Use it for:
- Profile multithreaded applications to find which threads and functions consume the most CPU or wall time
- Measure asyncio coroutine performance and identify context-switch overhead in async code
- Profile gevent greenlet applications to track per-greenlet execution time and call counts
- Export profiling results to callgrind format for visualization in kcachegrind or other analysis tools
- Continuously profile long-running services by starting and stopping yappi on demand without restarting the application
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Yappi is a deterministic profiler for Python that tracks CPU and wall-clock time across multithreaded, asyncio, and gevent applications, reporting per-function and per-thread statistics.
Yes, if you need to profile multithreaded, asyncio, or gevent applications. Yappi is the standard choice for these workloads because the standard library profilers do not handle them correctly. If you only profile single-threaded code, cProfile is simpler. No security vulnerabilities are known, maintenance is active, and the MIT license poses no restrictions.
Install
yappi on PyPI
pip
pip install yappiuv
uv add yappipoetry
poetry add yappiInstalling yappi
Before you install
Medium install friction due to compiled C extensions requiring platform-specific wheels. The package is actively maintained with recent releases and has been stable since its early releases. No runtime dependencies to manage.
License in practice
MIT license is permissive; you can use, modify, and distribute yappi with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
import yappi
yappi.set_clock_type("cpu")
yappi.start()
# your code here
yappi.get_func_stats().print_all()
yappi.get_thread_stats().print_all()
Requires Python 3.6 or later; compiled C extensions are platform-specific, so installation pulls prebuilt wheels for your OS and Python version.
Verify before relying
- Whether yappi's overhead is acceptable for production profiling of long-running services
- Performance comparison with standard library cProfile on single-threaded workloads
- Compatibility with Python 3.13 and 3.14 (listed in classifiers but not explicitly tested in examples)
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 150 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,257,062/month — #2,346 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: yappi-1.7.6-cp310-cp310-macosx_10_9_x86_64.whl; yappi-1.7.6-cp310-cp310-macosx_11_0_arm64.whl; yappi-1.7.6-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; yappi-1.7.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; yappi-1.7.6-cp310-cp310-musllinux_1_2_aarch64.whl; yappi-1.7.6-cp310-cp310-musllinux_1_2_x86_64.whl; yappi-1.7.6-cp310-cp310-win32.whl; yappi-1.7.6-cp310-cp310-win_amd64.whl; yappi-1.7.6-cp310-cp310-win_arm64.whl; yappi-1.7.6-cp311-cp311-macosx_10_9_x86_64.whl; yappi-1.7.6-cp311-cp311-macosx_11_0_arm64.whl; yappi-1.7.6-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; yappi-1.7.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; yappi-1.7.6-cp311-cp311-musllinux_1_2_aarch64.whl; yappi-1.7.6-cp311-cp311-musllinux_1_2_x86_64.whl; yappi-1.7.6-cp311-cp311-win32.whl; yappi-1.7.6-cp311-cp311-win_amd64.whl; yappi-1.7.6-cp311-cp311-win_arm64.whl; yappi-1.7.6-cp312-cp312-macosx_10_13_x86_64.whl; yappi-1.7.6-cp312-cp312-macosx_11_0_arm64.whl
Keywords: python, thread, multithread, asyncio, gevent, profiler
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
line-profilerline_profiler measures execution time on a…
permissive · top 5,000 on PyPI
py-spypy-spy is a sampling profiler that attaches to…
permissive · top 1,000 on PyPI
fastapi-profilerIntegrates pyinstrument profiling into FastAPI…
permissive · top 15,000 on PyPI
scaleneScalene profiles Python code to measure CPU,…
permissive · top 15,000 on PyPI
austin-distAustin is a frame stack sampler for CPython…
copyleft · top 5,000 on PyPI
pyinstrumentPyinstrument is a statistical call-stack…
permissive · top 5,000 on PyPI
django-cprofile-middlewareMiddleware that profiles Django view execution…
permissive · top 15,000 on PyPI
tunatuna visualizes Python performance profiles in…
copyleft · top 15,000 on PyPI
kekeWrites trace events in Perfetto/Chrome trace…
permissive · top 15,000 on PyPI
snakevizSnakeViz is a web-based viewer for Python…
permissive · top 5,000 on PyPI