Counting nanoseconds: benchmarking C++ code

Speaker: David Gross

Audience level: Intermediate

"If you don't benchmark your code, you don't care about its performance." Chandler Carruth

Benchmarking our code matters when we care about its speed. While it seems simple to use Google Benchmark and run a benchmark, there are many pitfalls and getting accurate results from a benchmark isn't an easy task. What to measure first? How comparable are the first and the thousandth iterations of our benchmark? What if we have to measure the speed of only one line of code? What are the limits of our measurements?

The talk will take an in-depth look at instructions optimization, and explain how to achieve accurate measurements. The talk will be rather low-level - looking at assembly, having hardware in mind - but applied to modern C++, and will describe several tools and libraries that C++ developers can use to make various measurements on their code.