Skip to content

Instantly share code, notes, and snippets.

@toastdriven
Created November 9, 2011 06:42
Show Gist options
  • Save toastdriven/1350631 to your computer and use it in GitHub Desktop.
Save toastdriven/1350631 to your computer and use it in GitHub Desktop.
Getting QCacheGrind Running & Working With Python Profilers

Get QCacheGrind Running

  • brew install qt --with-qt3support
  • brew install graphviz
  • sudo ln -s /usr/local/bin/dot /usr/bin/dot (?)
  • svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk/kcachegrind kcachegrind
  • cd kcachegrind/qcachegrind
  • qmake -spec 'macx-g++'
  • make

Install The Convertor

  • sudo pip install pyprof2calltree

Profile The Python Code

  • python -m cProfile -o <output_filename> <normal stuff here>
  • pyprof2calltree -i import.prof -o import.callgrind

Open QCacheGrind.app, hit "Open" & pull in your profiling data!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment