When profiling code it can be helpful to have a visualization of the profile to really show what areas of your program are taking the most time. The great RunSnakeRun application has been filling this roll for a while now but some of my colleagues have been turned off by the need to install wxPython. The web browsers we use every day are quickly becoming great visualization platforms so I thought it would be a nice project to make a Python profile viewer that works in the browser. Today, co-developer Erik and I are happy to announce the first official release of SnakeViz.
SnakeViz is currently unable to handle large profiles due to the difficulty of representing a large call tree as a JSON string, and the slow down most browsers experience when rendering an SVG with thousands of individual paths. For now, we think SnakeViz can handle call trees with less than a few thousand nodes. SnakeViz will fail gracefully if it is unable to process a profile and the table of statistics will still be complete and operational, so it’s not totally useless even when it cannot produce the visualization.
We have some ideas to improve the performance of SnakeViz in future releases and hope to someday make it equally useful for all profiles. We also plan to put an operational version of SnakeViz up on the web where you’ll be able to upload and store profiles, as well as send links to your colleagues so you can show the results of your hard work optimizing code. At some point we’d also like to add some different visualization types.
Check out the SnakeViz homepage for a full run down and installation instructions (it’s easy, we’re on PyPI). You can browse the code or even fork the project on GitHub. We appreciate feedback on how well SnakeViz works for you! Please leave comments here, submit issues on GitHub, or get in touch via social media.