Chapter 6 Memory Hierarchy -- Summary

Programmers who understand the nature of the memory hierarchy can exploit this understanding to write
more efficient programs, regardless of the specific memory system organization. In particular, we recommend
the following techniques:


1. Focus your attention on the inner loops where the bulk of the computations and memory accesses
occur. 集中在最内层的循环。
2.Try to maximize the spatial locality in your programs by reading data objects sequentially, in the order
they are stored in memory.提高空间locality,顺序读取数据。

根据 memory moutain(section 6.6.1)和 section 6.6.3的结论,这个inner loop顺序读取内存的大小最好小于L1 cache的大小。
3. Try to maximize the temporal locality in your programs by using a data object as often as possible
once it has been read from memory.
4. Remember that miss rates are only one (albeit important) factor that determines the performance
of your code. The number of memory accesses also plays an important role, and sometimes it is
necessary to trade off between the two. 记住,cache的miss rate只是一个影响性能的因素,内存访问次数也很关键。

这个结论来自与section 6.6.2.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值