Skip to content

Instantly share code, notes, and snippets.

@mcouthon mcouthon/
Last active Dec 30, 2018

What would you like to do?
A convenience function to profile a python script
# This is the path to snakeviz executable in a dedicated venv
alias snake='/Users/pavel/dev/venvs/snakeviz/bin/snakeviz'
profile() {
python -m cProfile -o $tmp_file "$@"
snake $tmp_file
rm $tmp_file
# To use, simply run:
# >>> profile ARG1 ARG2 ARG3...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.