Skip to content

Instantly share code, notes, and snippets.

@durden
Created December 12, 2012 23:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save durden/4272487 to your computer and use it in GitHub Desktop.
Save durden/4272487 to your computer and use it in GitHub Desktop.
Dump Python pstats file to stdout sorted by cumulative stat
if __name__ == "__main__":
import sys
import pstats
stats = pstats.Stats(sys.argv[1])
stats.strip_dirs()
stats.sort_stats('cumulative')
stats.print_stats()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment