Post

Profiling with Python: cProfile and RunSnakeRun

This is my favorite way to analyze the performance of my Python scripts:

  1. Call the script with cProfile: python -m cProfile -o profile.dat main.py
  2. Open the profiler data with RunSnakeRun: %PYTHON_ROOT%\scripts\runsnake.exe A nice GUI will start up, and you can open the profile.dat file in there.

You have to install RunSnakeRun first, of course. You should choose the easy_install procedure I described here for the runsnake.exe to be installed in the scripts directory. You can find the current RunSnakeRun package on pypi.

RunSnakeRun homepage

This post is licensed under CC BY-ND 4.0 by the author.