Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

cProfile flamegraph generator

Project description

Flamegraph generator for python’s cProfile stats.

Flamegraphs allow to visualize relations between functions in a very compact and understandable manner.

Flameprof solves main problems of built-in cProfile reporting and can replace gprof2dot because later outputs very huge graphs with a lot of noise.

Flameprof works with profile stat files obtained by Profile.dump_stats() call or via direct script profiling:

python -m cProfile -o


Via pip:

pip install flameprof

Or you can invoke directly:

python > output.svg

Native svg (–format=svg)

Native svg features:

  • compact function names with full names in a tooltip
  • precise timings (cumulative and total)
  • call counts (in a tooltip on hover)
  • green bars show stack frames where flameprof starts to guess timing ratios
  • inverted flamegraph to show total time of all calls

Graph width, row height, font size and threshold can be set via appropriate cli options.

flameprof > requests.svg
Requests profile

Inverted flamegraph:

Requests profile

(Images are clickable)

Svg generated with (–format=log)

Also flameprof can output trace log suitable as input for

You can treat “samples” as microseconds by default (see --log-mult option).

flameprof --format=log | flamegraph > requests-flamegraph.svg
Requests profile with

(Image is clickable)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flameprof, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size flameprof-0.4.tar.gz (7.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page