JA EN

#false-sharing

1 articles

01 ·Data Structures·★ MEMBER·11 min read Cache-Friendly Code — Why Two O(n) Loops Can Differ by 10× Two implementations with identical complexity can differ by an order of magnitude, because the CPU never fetches one value — it fetches a 64-byte block. Locality, cache lines, arrays versus linked lists, AoS versus SoA, loop order and false sharing, from zero assumed background to checking it yourself with perf.