CPU Cache and False Sharing

Cache Hierarchy

  • L1: ~4 cycles
  • L2: ~12 cycles
  • L3: ~40 cycles
  • RAM: ~200 cycles

Cache Lines

  • 64-byte lines

False Sharing

Padded Struct Benchmark