diff --git a/scripts/profile b/scripts/profile new file mode 100755 index 0000000..ccbfc70 --- /dev/null +++ b/scripts/profile @@ -0,0 +1,13 @@ +#!/bin/sh -eu + +cd "$RUN_DIR" + +outfile="profile-$(date '+%Y%m%d-%H%M%S').txt" + +[ -z "${DEBUG:-}" ] || set -x + +echo "# Writing profiler stats to: $outfile" +python -m cProfile -o "$outfile" -m unwind "$@" + +echo "# Loading stats file: $outfile" +python -m pstats "$outfile"