Using snakeviz for profiling Python code
To profile complicated and convoluted code.
Snakeviz is a cool GUI tool to analyze cProfile profile files.
Just launch your code like this
python3 -m cProfile -o profile_file.cprofile
And then just analyze with snakeviz.
They have a server GUI and a jupyter notebook plugin.
Also you can launch their tool from within a docker container:
snakeviz -s -H 0.0.0.0 profile_file.cprofile
Do not forget to
EXPOSE necessary ports. SSH tunnel to a host is also an option.
SnakeViz is a browser based graphical viewer for the output of Python's cProfile module.