Profiling resources

Tools

  • valgrind
  • perf
  • /usr/bin/time --verbose
  • Tracy
  • htop
  • Google Benchmark
  • gprof

Graph tools

Compiler options

Enabling in gcc

Use -p for prof and -pg for gprof. But it will take longer to run.

References

Favourite C++ features

And wish list

C++17 Boost filesystem execution policy: parallel algorithm support for range-based for loops - potential for easily parallelsing existing code structured bindings clamp std::optional [[maybe_unused]] C++20 Concepts Concepts are a revolutionary approach for writing templates! They allow you to put constraints on template parameters that improve the readability of code, speed up compilation time, and give better error messages. C++20 gives us language support (new keywords - requires, concept) and a set of predefined concepts from the Standard Library. [Read More]

GDB

Debugger crib sheet

Adding debug symbols gcc -g hello.c gdb a.out # Run program run # Run and immediately break start # View code at current break point list # Break main b main # Break at line 9 b 9 TUI mode - text user interface Type ctrl-X A ctrl L - repaint ctrl X2 - multiple windows ctrl X2 - view registers tui reg float - view floating registers ctrl x 1 - source code view ctrl p/n - command history Python interpreter built in (since version 7) import os print(os. [Read More]