Created
January 27, 2010 01:18
-
-
Save jbalogh/287441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Load and print hotshot stats from a file. | |
Usage: | |
python load_prof.py <file> | |
Prints out the top 20 functions, sorted by call time and number | |
of calls. | |
ipython load_prof.py <file> | |
Does the same as above, but drops you into an IPython shell with | |
the file loaded in ``stats`` so you can play with it more. | |
""" | |
import hotshot.stats | |
import sys | |
stats = hotshot.stats.load(sys.argv[1]) | |
stats.sort_stats('time', 'calls') | |
stats.print_stats(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment