Skip to content

Instantly share code, notes, and snippets.

@mcouthon
Last active December 30, 2018 12:44
Show Gist options
  • Select an option

  • Save mcouthon/ae810d05722829c7116efa75253ef6e1 to your computer and use it in GitHub Desktop.

Select an option

Save mcouthon/ae810d05722829c7116efa75253ef6e1 to your computer and use it in GitHub Desktop.

Revisions

  1. mcouthon revised this gist Dec 30, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion Profile.sh
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,7 @@ profile() {
    python -m cProfile -o $tmp_file "$@"
    snake $tmp_file
    rm $tmp_file
    }
    }

    # To use, simply run:
    # >>> profile PATH_TO_SCRIPT.py ARG1 ARG2 ARG3...
  2. mcouthon created this gist Dec 30, 2018.
    9 changes: 9 additions & 0 deletions Profile.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # This is the path to snakeviz executable in a dedicated venv
    alias snake='/Users/pavel/dev/venvs/snakeviz/bin/snakeviz'

    profile() {
    tmp_file=$(mktemp)
    python -m cProfile -o $tmp_file "$@"
    snake $tmp_file
    rm $tmp_file
    }