Profiling with Python: cProfile and RunSnakeRun
This is my favorite way to analyze the performance of my Python scripts:
- Call the script with cProfile:
python -m cProfile -o profile.dat main.py - Open the profiler data with RunSnakeRun:
%PYTHON_ROOT%\scripts\runsnake.exeA 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.
This post is licensed under CC BY-ND 4.0 by the author.