Skip to content

Instantly share code, notes, and snippets.

@alexxv
Created October 7, 2020 15:01
Show Gist options
  • Save alexxv/a0de6786f25a7de755a0257df73cedd7 to your computer and use it in GitHub Desktop.
Save alexxv/a0de6786f25a7de755a0257df73cedd7 to your computer and use it in GitHub Desktop.
Profile python script
# make sure to run: pipx install snakeviz
profile() {
tmp_file=$(mktemp)
python -m cProfile -o $tmp_file "$@"
snakeviz $tmp_file
rm $tmp_file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment