cpu-cache

What is a “cache-friendly” code?

本小妞迷上赌 提交于 2019-11-25 22:32:48
问题 What is the difference between \" cache unfriendly code \" and the \" cache friendly \" code? How can I make sure I write cache-efficient code? 回答1: Preliminaries On modern computers, only the lowest level memory structures (the registers ) can move data around in single clock cycles. However, registers are very expensive and most computer cores have less than a few dozen registers (few hundred to maybe a thousand bytes total). At the other end of the memory spectrum ( DRAM ), the memory is