Search⌘ K
AI Features

Performance Counters

Explore the role of hardware performance counters in monitoring CPU metrics such as instructions, cycles, and cache misses. Learn about tools like VTune, perf, and DTrace for collecting data. Understand best practices for performance testing including early measurement, data plotting, and choosing scalable algorithms to enhance C++ code efficiency.

Performance monitoring

Apart from the obvious properties, such as execution time and memory usage, it can sometimes be beneficial to measure other things. Either because they are more reliable or because they can give us better insights into what is causing our code to run slow.

Many CPUs are equipped with hardware performance counters that can provide us with metrics such as the number of instructions, CPU cycles, branch mispredictions, and cache misses. We haven't introduced these hardware aspects yet in this course, and we will not explore performance counters in depth. ...