Skip to content
Yet Another Python Profiler, but this time support Multithread/CPU time profiling.
Branch: master
Clone or download
Latest commit 07f419d Feb 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc change supported python versions and improve doc formatting Jan 18, 2019
tests merge from bitbucket Jan 17, 2019
.gitignore merge from bitbucket Jan 17, 2019
.travis.yml remove python 3.2 and add 3.7-dev [travis] Jan 18, 2019
INSTALL sync from latest hg rep. Feb 10, 2014
LICENSE
MANIFEST.in Update MANIFEST.in Jan 18, 2019
README.md
THANKS.md
_yappi.c
callstack.c
callstack.h
config.h sync from latest hg rep. Feb 10, 2014
debug.h sync from latest hg rep. Feb 10, 2014
freelist.c
freelist.h
hashtab.c
hashtab.h sync from latest hg rep. Feb 10, 2014
logo.tif sync from latest hg rep. Feb 10, 2014
mem.c
mem.h
setup.py
timing.c
timing.h COSMETIC: remove unnecessary white lines from files. Make EOLs consis… Jun 25, 2014
yappi.py merge from bitbucket Jan 17, 2019

README.md

Logo

Yappi

Yet Another Python Profiler, but this time support Multithread/CPU time profiling.

Build Status

Motivation

CPython standard distribution comes with three profilers. cProfile, Profile and hotshot. cProfile is implemented as a C module based on lsprof, 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 application.It is impossible to profile an application retrieve the statistics then stop and then start later on the fly (without affecting the profiled application).

Highlights

  • Profiler can be started/stopped at any time from any thread in the application.
  • Profile statistics can be obtained from any thread at any time.
  • Profile statistics can show actual CPU Time used instead of Wall time.
  • "Profiler pollution" (effect on the application run-time) is very minimal.

Installation

Can be installed via PyPI

$ pip install yappi

OR from the source directly.

$ pip install git+https://github.com/sumerc/yappi#egg=yappi

Documentation

Features

  • Profiler results can be saved in callgrind or pstat formats. (new in 0.82)
  • Profiler results can be merged from different sessions on-the-fly. (new in 0.82)
  • Profiler results can be easily converted to pstats. (new in 0.82)
  • Profiling of multithreaded Python applications transparently.
  • Supports profiling per-thread CPU time (new in 0.62)
  • Profiler can be started from any thread at any time.
  • Ability to get statistics at any time without even stopping the profiler.
  • Various flags to arrange/sort profiler results.
  • Supports Python >= 2.7.x

Limitations:

  • Threads must be derived from "threading" module's Thread object.

Talks

  • Python Performance Profiling: The Guts And The Glory

    Youtube link

PyCharm Integration

Yappi is the default profiler in PyCharm. If you have Yappi installed, PyCharm will use it. See the official documentation for more details.

You can’t perform that action at this time.