繁体   English   中英

计算应用程序的加速时间(练习本)

[英]Calculating speed-up time of an application (book exercise)

我一直在阅读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

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

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

现在替换,您将到达解决方案b。

答: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秒

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM