Saturday, May 9, 2009

RunSnakeRun - View performance profile in Python

In my previous post on Greenlet/Eventlet, i went about testing and profiling the apps i wrote just to get a feel but admittedly, i do find reading the statistical data gathered thru profiling laborious and at times, it could get quite tiring..

So, i've found a nice application that can read python application's profiling data. Its called RunSnakeRun which is pretty cool as it helps to visualize the data in a much more interesting and readable manner and the caveat is that you will need to download the appropriate wxPython binaries or source code to build for the platform you're using. In this case, i'm using Ubuntu Linux to run the profiling.

Besides the proper wxPython, you will need to follow the instructions on the site to begin profiling and viewing your profiled data.

On a side note, if you are curious about profiling applications using python but have little idea what its all about, here's a link that gives you an idea why profiling is important in python code.


The screen shot i have for you is a caller-callee graph with runtimes (accumulated and exclusive) which allows a python developer to quickly isolate poor performing code and also provides you an idea how code is being executed. E.g. this screenshot illustrated the concurrent execution of the Greenlets


Obviously, this application allows a developer to quickly isolate problematic code using a square map since it highlights the largest consumer of time by the largest square and also provides color highlighting when hovering your mouse over the different squares. Neat!


0 comments: