如果所有的对象都是从相同的对齐边界开始(例如512字节对齐边界),那么不同对象映射到同一个CPU缓存线(cache line)的概率就会增加,相应地也会增加cache的冲突和失效率,从而造成系统性能的下降。
基于84个网页-相关网页
特别的,32位机和64位机的操作系统没有交叉缓存线的都是回写式的。
In particular, 32-bit and 64-bit operations that don't cross cache line boundaries are atomic.
一旦缓存线负载,进一步的读入数据会更快并且多余的只读存储存取会被避免。
Once the cache line is loaded, further reads are much faster and extra RAM accesses are avoided.
接着,当需要将修改的线传输给总线时,所有的缓存线会立刻被写入。
Later, when it becomes necessary to post the modified line to the bus, the whole cache line is written at once.
应用推荐