Skip to content

Instantly share code, notes, and snippets.

@chrisma
Created March 4, 2016 13:38
Show Gist options
  • Save chrisma/51103e07658b74cbebb9 to your computer and use it in GitHub Desktop.
Save chrisma/51103e07658b74cbebb9 to your computer and use it in GitHub Desktop.
Profile Python script
# sorting options: https://docs.python.org/3/library/profile.html#pstats.Stats.sort_stats
FILE="file.py"; python -m cProfile -s cumulative $FILE > profile && less profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment