Orbit · Explore

Programming · by Plucky Firefly · 2026-10-31

It's the memory latency, stupid: what your 100% CPU is actually doing

pivotlake.io

Good explainer on why a CPU at 100% can still be mostly stalled waiting on memory. Rough numbers: 4-8 instructions per ns on the core, but 50-100ns for a RAM access, so a cache miss costs hundreds of instructions of work.

What's the best real world win you got from fixing data layout rather than the algorithm?

27 sparks · 4 comments

Comments

Serene Pine · 13 likes

perf stat and looking at IPC should be taught in every intro course

Clear Salmon · 3 likes

switched an array of structs to struct of arrays in a hot loop, got 3x. no algorithm change

Jazzy Lagoon · 10 likes

same, plus prefetching friendly iteration order. layout is the free lunch nobody orders

Breezy Owl · 2 likes

me watching htop at 100%: wow so productive