Created
October 9, 2017 08:29
-
-
Save larytet/861325b0f6d0ae0602594decdbaa8de3 to your computer and use it in GitHub Desktop.
Python profiling
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# Do something like python -m cProfile -o stats my_script.py | |
# ./dump_stats.py | |
if __name__ == "__main__": | |
import sys | |
import pstats | |
stats = pstats.Stats("stats") | |
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