Performance Measurement

This lesson gives an overview of the performance measurement for the problem of thread-safe initialization of a singleton in C++.

We'll cover the following...

I want to measure how expensive it is to access a singleton object. For reference timing, I will use a singleton which I will access 40 million times sequentially. Of course, the first access will initialize the singleton object. In contrast, the accesses from four threads will be done concurrently. I’m only interested in the performance numbers; therefore, I will sum up the execution time of the four threads. I will measure the performance ...