Recommended procedure for profiling python scripts
Assuming we want to profile myscript.py, run:
profile_commands.sh
python3 -m cProfile -o myscript.profile myscript.pyIn order to view it, I strongly recommend runsnakerun:
example.sh
runsnake myscript.profileYou can install runsnake on Ubuntu using
example.sh
sudo apt -y install runsnakerunCheck out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow