Created
February 10, 2019 12:39
-
-
Save geoffroy-noel-ddh/571fb6489e5ec0b3346ce8573d98c69d to your computer and use it in GitHub Desktop.
Profiling python
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
# Setup | |
# see https://jiffyclub.github.io/snakeviz/ | |
pip install snakeviz | |
# run your script and generate profiling info | |
python -m cProfile -o program.prof myscrypt.py myargument | |
# visualise the results in your browser | |
snakeviz program.prof | |
# if used inside a container / VM | |
# 1. open the port 8080 on the VM | |
# or create a port forwarding (e.g. Virtualbox) | |
# 2. start the UI | |
snakeviz program.prof -s -H 0.0.0.0 | |
# 3. then open http://localhost:8080 or http://MYVMIP:8080 with your browser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment