RunSnakeRun is a small GUI utility that allows
you to view (Python) HotShot, cProfile or Profile profiler dumps in a sortable GUI view. It
loads hotshot dumps incrementally in the background so that you can begin
viewing the profile results fairly quickly.
If you already have Python setuptools installed (a.k.a. easy_install), you should be able to install with:
easy_install RunSnakeRun
easy_install numpy
easy_install wxPython
As shown, you will require a modern wxPython and Python installation with Numpy/Numeric installed. We don't automatically install these with easy_install, as that can cause problems for those who have manually installed the packages or who are behind corporate firewalls.
You can manually download the package and run:
python setup.py install
to install the package. This will setup a script named "runsnake" on Linux machines which launches the profiler.
To record a hotshot profile of your application:
import hotshot
profiler = hotshot.Profile( "test.profile", lineevents=0 )
command = '''reactor.run()''' # your mainloop call here, this is for a Twisted app...
profiler.runctx( command, globals(), locals())
profiler.close()
Or, to use cProfile:
import cProfile
command = """reactor.run()"""
cProfile.runctx( command, globals(), locals(), filename="OpenGLContext.profile" )
To view the results of your run:
python ../runsnakerun/runsnake.py test.profile
There will be a brief delay as the application is created and begins the loading process, then you should see something like this:
Click on the column titles to sort by that property. As the loading proceeds the screen will refresh/flash to show the new data. Very large data-sets can take quite a long time to complete loading.
RunSnakeRun is reasonably stable. I don't tend to do much work on it, as it tends to just work. If you have a bug, feature or idea, feel free to check out the code and implement the new feature. I'm willing to entertain new features or bug-fix requests as well. The code is available in bzr here:
bzr branch http://www.vrplumber.com/bzr/runsnakerun/
cd runsnakerun
python setup.py develop
You can contact me directly if you'd like to contribute (if there is interest we can move development to LaunchPad at some point).