Yet Another Python Profiler
Yet Another Python Profiler, but this time thread&coroutine aware.
- Fast: Yappi is fast. It is completely written in C and lots of love&care went into making it fast.
- Unique: Yappi supports multithreaded and asynchronous code profiling. Tagging/filtering multiple profiler results has interesting use cases.
- Intuitive: Profiler can be started/stopped and results can be obtained from any time and any thread.
- Standarts Complaint: Profiler results can be saved in callgrind or pstat formats.
- Rich in Feature set: Profiler results can show either Wall Time or actual CPU Time and can be aggregated from different sessions. Various flags are defined for filtering and sorting profiler results.
- Robust: Yappi had seen more than 8 years of production usage.
CPython standard distribution comes with three deterministic profilers.
cProfile is implemented as a C module based on
Profile is in pure Python and
hotshot can be seen as a small subset of a cProfile. The major issue is that all of these profilers lack support for multi-threaded programs and CPU time.
If you want to profile a multi-threaded application, you must give an entry point to these profilers and then maybe merge the outputs. None of these profilers are designed to work on long-running multi-threaded applications. It is also not possible to profile an application that start/stop/retrieve traces on the fly with these profilers.
Now fast forwarding to 2019: With the latest improvements on
asyncio library and asynchronous frameworks, most of the current profilers lacks the ability to show correct wall/cpu time or even call count information per-coroutine. Thus we need a different kind of approach to profile asynchronous code. Yappi, with v1.2 introduces the concept of
coroutine profiling. With
coroutine-profiling, you should be able to profile correct wall/cpu time and call count of your coroutine. (including the time spent in context switches, too). You can see details here.
Can be installed via PyPI
$ pip install yappi
OR from the source directly.
$ pip install git+https://github.com/sumerc/yappi#egg=yappi
Coroutine Profiling (new in 1.2)
Note: Yes. I know I should be moving docs to readthedocs.io. Stay tuned!
- Threads must be derived from "threading" module's Thread object.
Special thanks to A.Jesse Jiryu Davis:
Yappi is the default profiler in
PyCharm. If you have Yappi installed,
PyCharm will use it. See the official documentation for more details.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size yappi-1.2.3.tar.gz (45.6 kB)||File type Source||Python version None||Upload date||Hashes View hashes|