How to visualize Python profile data with SnakeViz

Profile data visualized with SnakeViz
Profile data visualized with SnakeViz

SnakeViz is a beautiful visualization tool for the profile statistics generated by the Python cProfile module. The data is presented in the browser as a colorful sunburst and you explore the data from the inner core outwards. You can also choose how deep you want the sunburst. Below the visualization, SnakeViz also presents the typical function call table with various columns and this table can be sorted based on any of the columns.

Installing SnakeViz is easy:

$ sudo pip install snakeviz

To run it on a stats file:

$ snakeviz foo.pstats

The visualization is opened in your default browser with the URL http://127.0.0.1:8080

Tried with: SnakeViz 0.2.1, Python 2.7.6 and Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s