pip install snakeviz python import snakeviz @snakeviz.profile def my_function(): my_function() snakeviz your_script.py