计算申请的加速时间(书本练习)

时间:2017-03-18 18:22:43

标签: performance cpu-architecture

我一直在阅读Patterson和Hennessy的计算机组织和设计,偶然发现了一个有三个给定解决方案的练习。我找不到哪个是正确的。我尝试用书中给出的性能方程计算:

  

CPU执行时间=(指令计数* CPI)/时钟速率

但它不起作用。这是问题:

A given application written in Java runs 15 seconds on a desktop processor.
A new Java compiler is released that requires only 0.6 as many instructions as the old compiler. 
Unfortunately, it increases the CPI by 1.1.
How fast can we expect the application to run using this new compiler? 
Pick the right answer from the three choices below:

a. (15 * 0.6) / 1.1 = 8.2 sec
b. 15 * 0.6 * 1.1 = 9.9 sec
c. (15 * 1.1) / 0.6 = 27.5 sec

对正确答案的一些见解以及使用该特定公式获得的原因将会有所帮助。谢谢!

2 个答案:

答案 0 :(得分:1)

new instruction count = old instruction count * 0.6
new CPI = old CPI * 1.1

现在替换,你将得到解决方案b。

答案 1 :(得分:0)

A:15秒= InsA * CPIA * ClockRate ClockRate = 15秒/(InsA * CPIA)

B:TimeB =(0.6 * InsA)*(1.1 * CPIA)* ClockRate TimeB =(0.6 * InsA)*(1.1 * CPIA)* 15秒/(InsA * CPIA)

TimeB = 0.6 * 1.1 * 15秒= 9.9秒