Index
Software
Development
Python Modules
Profile Python Program

Profile Python Program

python -m cProfile -o profile.out example.py

1. show text
python -c "import pstats; p=pstats.Stats('profile.out'); p.sort_stats('time').print_stats()"

1. or draw a plot
pip install gprof2dot
gprof2dot -f pstats profile.out | dot -Tsvg -o output.svg
Created by sine. Last modification: 2022-06-05 15:28:26
Software