Skip to content

Instantly share code, notes, and snippets.

@ymollard
Created August 22, 2016 18:07
Show Gist options
  • Save ymollard/081580b29b7cf2494956489d352d6d4a to your computer and use it in GitHub Desktop.
Save ymollard/081580b29b7cf2494956489d352d6d4a to your computer and use it in GitHub Desktop.
Profile a python module and plot
pip install pyprof2calltree
sudo apt-get install kcachegrind
python -mcProfile -o module.cprof $(python -c 'import runpy; print runpy.__file__.rstrip("co")') the.module.to.profile
pyprof2calltree -k -i module.cprof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment