View on GitHub

C++ Benchmarking

SSC Compact Course

C++ Benchmarking

License: MIT GitHub Workflow Status codecov

We use C++ to get good performance, so measuring and understanding the performance characteristics of our code is vital, for example to identify bottlenecks or to determine if a change to the code actually improves the performance. Unfortunately it is also complicated. In this course we will cover three different ways to benchmark our code, and discuss the pros and cons of each method.


download slides as pdf download course description as pdf

Getting started

To clone the repo and compile the code:

git clone --recursive
cd cpp-benchmarking
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

This code contains two very simple map implementations, vec_map and sorted_vec_map, along with benchmarks of these and other map implementations.




perf/branch_miss.png perf/cache_miss.png




This repo was quickly set up using the SSC C++ Project Cookiecutter.