...

/

Performance Counters

Performance Counters

Learn about performance monitoring and testing, as well as the perf tool for best practices.

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. ...