Coder Social home page Coder Social logo

yappi's Introduction

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

  • Per-thread function stats can be obtained
  • 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.

yappi's People

Contributors

sumerc avatar devxpy avatar ajdavis avatar nirs avatar alioguzhan avatar orivej avatar frohoff avatar flupke avatar zvyn avatar nicoddemus avatar alexandrul avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.