Python Profiling & Performance

Profiling Methods

python -m cProfile -o out.prof do.py

Visualisation

Use snakeviz.

Install pipx install snakeviz.

snakeviz out.prof

Or, use tuna which is slightly less misleading.

Other

Austin can attach to running programs.

Austin.

austin -f -o out.prof python3 do.py

I haven't worked out how to visualise this.