Skip to content

Modern Performant Linux Cpp

Core notes distilled from talks by Scott Meyers, Rainer Grimm, Perplexity, and Gemini 3 Pro.

Performance

As c++ programmers on Linux, we care about performance. To paraphrase Scott Meyers in a c++ conference talk- "If we didn't care about performance, we would be using python- over in the next room".

At a foundation, we must understand what happens at each step in a life cycle of a c++ program. What are optimisation opportunities at each stage?

1 the compiler will unroll loops, remove unused code, place variables in registers, etc

2 the processor will run operations out of order, and make branch predictions; branch mispredictions are very costly; try to write branchless code or with fewer branches

3 the cache will perfetch the next instructions or data in a traditional von neumenn cpu architecture

4 the kernel (kernel bypass?)

5 non-blocking IO (epoll and broadcast)

Each part works hard to optimize its own respective stage.

2025-11