-
Notifications
You must be signed in to change notification settings - Fork 163
/
PROFILING.txt
29 lines (23 loc) · 1.17 KB
/
PROFILING.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Some details about profiling possibilities
==========================================
First option (cProfile and gprof2dot)
-------------------------------------
python -m cProfile -o output.pstats ./main.py
scripts/gprof2dot.py -f pstats output.pstats -n 0.1 -e 0.02| dot -Tpng -o output2.png
Second option (cProfile and pstats)
-----------------------------------
./friture.py --python
Third option (cProfile, convert to kcachegrind)
------------------------------------------------------------------
pip install pyprof2calltree
python -m cProfile -o friture.cprof ./main.py
pyprof2calltree -i .\friture.cprof
kcachegrind/qcachegrind
Fourth option (sysprof system-wide profiler on Linux)
----------------------------------------------------
For sysprof, either use "sudo m-a a-i sysprof-module" to build the module for your current kernel,
on Debian-like distributions, or use a development version of sysprof (>=1.11) and a recent
kernel (>=2.6.31) that has built-in support, with in-kernel tracing as an addition.
sysprof
./gprof2dot.py -f sysprof sysprof_profile_kernel| dot -Tpng -o output_sysprof_kernel.png
TODO : write a converter from sysprof to callgrind (similar to lsprofcalltree)