Book Image

Mastering Python High Performance

Book Image

Mastering Python High Performance

Overview of this book

Table of Contents (15 chapters)

KCacheGrind – pyprof2calltree


The first GUI tool we will see is KCacheGrind. It is a data visualization tool designed to parse and display different formats of profiling data. For our case, we will display the output from cProfile. However, to do this, we'll also need the help from the command-line tool called pyprof2calltree.

This tool is a rebranding of a very popular one called lsprofcalltree.py (https://people.gnome.org/~johan/lsprofcalltree.py). It tries to behave more like the kcachegrind-converter (https://packages.debian.org/en/stable/kcachegrind-converters) package from Debian. We'll use the tool to transform the output from cProfile into something KCacheGrind can understand.

Installation

To install pyprof2calltree, you'll first need to install the pip command-line utility. Then, just use the following command:

$ pip install pyprof2calltree

Note that all installation steps and instructions are meant for the Ubuntu 14.04 Linux distribution, unless otherwise noted.

Now, for KCacheGrind...