...
Code Block | ||||
---|---|---|---|---|
| ||||
import pstats stats = pstats.Stats('test.prof') stats.strip_dirs().sort_stats(pstats.SortKey.TIME).print_stats() |
This script print data sorted by tottime
column.
We can also make an image from data:
- Install gprof2dot :
pip install gprof2dot
- run :
python -m gprof2dot -f pstats test.prof | dot -Tsvg -o output.svg