Flamegraphs can help to optimize the program a lot. So let's create one!
- Install perf with use flag
unwind
enabled - Download flamegraph.pl and stackcolllapse-perf.pl
- Run
perf record -F 99 --call-graph dwarf -- ‹your program›
- Do all the things that make your program slow
- Close your program
- Run
perf script | stackcollapse-perf.pl > out.folded