performance - 从 AMAT 中寻找平均惩罚

标签 performance caching memory computer-architecture

当我只有一个缓存时,我可以计算惩罚。但是当我看到两个并行访问的 L1 缓存(一个用于数据,一个用于指令)时,我不确定该怎么做。当我看到时钟周期而不是实际时间(如 ns)时,我也不确定该怎么做。

如何使用这些新参数计算平均失误惩罚?

我是只使用公式两次,然后计算失误惩罚的平均值,还是还有更多?

AMAT = hit time + miss rate * miss penalty  

例如我有以下值:

AMAT = 4 clock cycles  
L1 data access = 2 clock cycle (also hit time)  
L1 instruction access = 2 clock cycle (also hit time)  
60% of instructions are loads and stores  
L1 instruction miss rate = 1%  
L1 data miss rate = 3%  

这些价​​值观如何融入 AMAT?

最佳答案

简答

平均内存访问时间 (AMAT) 通常是通过将指令总数除以为内存请求服务所花费的周期总数来计算的。

详情

Computer Architecture a Quantiative Approach, 5th edition 的 B-17 页上AMAT 定义为:

Average memory access time = % instructions x (Hit time + instruction miss rate x miss penalty) + % data x (Hit time + Data miss rate x miss penalty)`.

正如您在此公式中所见,每条指令都计为一次内存访问,而对数据(加载/存储)进行操作的指令构成一次额外的内存访问。

请注意,使用 AMAT 时有许多简化说明,具体取决于您要执行的性能分析。我之前引用的同一本教科书指出:

In summary, although the state of the art in defining and measuring memory stalls for out-of-order processors is complex, be aware of the issues because they significantly affect performance. The complexity arises because out-of-order processors tolerate some latency due to cache misses without hurting performance. Consequently, designers normally use simulators of the out-of-order processor and memory when evaluating trade-offs in the memory hierarchy to be sure that an improvement that helps the average memory latency actually helps program performance.

我引用这句话的意思是,在实践中,AMAT 用于在各种不同的选项之间进行近似比较。因此,总是会使用简化的假设。但在计算AMAT时一般会将指令和数据的内存访问次数加在一起得到总访问次数,而不是单独计算。

关于performance - 从 AMAT 中寻找平均惩罚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34115363/

相关文章:

.net - 1.2GB内存异常

java - 操纵内存占用

java - 为什么从 Java 12 开始 JVM 启动速度更快

c++ - 为什么排序组的分组求和比未排序的组慢?

IE 中的 jQuery 数据表优化,96.7% 的时间花在 offsetWidth 上

java - 在spring cache中通过方法访问返回数据

c++ - 如何获得适合 gpu 内存的最大数组大小?

php - 改善服务器响应时间

asp.net - 在 ASP.NET 应用程序中使用缓存的优点和缺点?

node.js - Node.js 中的自过期缓存