Skip to content

Performance mindset and correctness first ​

If you ask us, performance is the area of C++ engineering where it is easiest to be confidently wrong. Microarchitecture complexity runs far ahead of human intuition: change code by feel, and nine times out of ten you are optimizing the 5% while the real bottleneck lies dormant in the other 95%. So the first thing this volume does is not teach you any single optimization trick — it sets the mindset first: correct first, then fast; measure first, then optimize.

This chapter does three things. With a piece of lookup code where both variants are O(log⁡n), we spell out why efficiency (algorithmic complexity) and performance (real behavior on hardware) are not the same thing; we lay down the two iron rules and the Amdahl ceiling that run through the whole volume; and we settle the sanitizer toolchain in place as the "correctness foundation" — a performance number without correctness backing it is not to be trusted, period.

This chapter is the volume's thesis entry point. ch01's benchmark methodology picks up from here, swapping "I feel like" for "I measured it".

In this chapter ​

pdf-latest-4-g85128cc · 85128cc · 2026-10-05