There's a special kind of bug that only shows up after you've made your code "better." You swap in the data structure everyone agrees is more efficient, the microbenchmark cheers, you commit — and then the real system quietly starts burning CPU. This is the story of how I replaced std::deque with boost::circular_buffer in my audio player, watched playback CPU jump from 1–3% to 20–30%, and ended up reverting the whole thing a week later.
The punchline up front: for a byte-streaming FIFO, std::deque beat boost::circular_buffer by at least 2×, and the "obvious" reasons circular buffers are supposed to be faster never applied.
The setup
. Build with g++ -O2 -std=c++17 (Boost's circular_buffer is header-only) and run; they print the tables above.
SOCIAL SHARE CARD GENERATOR