Created
June 2, 2011 22:45
-
-
Save anonymous/1005510 to your computer and use it in GitHub Desktop.
pyrprofile: profile Python script
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 bash | |
## pyprofile: profile Python script | |
## $Revision$ | |
## Copyright 2011 Michael M. Hoffman <[email protected]> | |
set -o nounset | |
set -o pipefail | |
set -o errexit | |
if [ $# == 0 ]; then | |
echo usage: "$0" CMDLINE... | |
exit 2 | |
fi | |
PROF="$1.$(date +%Y%m%dT%H%M%S).prof" | |
python -m cProfile -o "$PROF" "$@" | |
python -m pstats "$PROF" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment