On Apr 16, 2020, at 01:16, Werner LEMBERG <w...@gnu.org> wrote: > > Have you ever tried valgrind's `callgrind` tool for profiling (and > using `kcachegrind` for displaying the results)? While very slow it > would avoid temperature issues and the like – no need to call it > multiple times to get reliable values.
In case it helps, here are notes on the last time I used callgrind (long ago): # Callgrind Build lilypond with optimization enabled. ```cpp #include “valgrind/callgrind.h” Paper_book * Book::process (Output_def *default_paper, Output_def *default_layout) { CALLGRIND_TOGGLE_COLLECT; Paper_book *paper_book = process (default_paper, default_layout, 0); CALLGRIND_TOGGLE_COLLECT; return paper_book; } ``` ```shell valgrind --tool=callgrind --collect-atstart=no out/bin/lilypond /media/sf_lilypond_git/input/regression/rest-dot-position.ly callgrind_annotate callgrind.out.PID > whatever.txt ```