简体   繁体   English

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

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

I've been reading Computer Organization and Design by Patterson and Hennessy and stumbled upon an exercise with three given solutions. 我一直在阅读Patterson和Hennessy撰写的《计算机组织与设计》,偶然发现了具有三个给定解决方案的练习。 I can't find which is the correct one. 我找不到哪个是正确的。 I tried calculating with the performance equation given in the book: 我尝试使用书中给出的性能方程式进行计算:

CPU Execution time = (Instruction count * CPI) / Clock rate CPU执行时间=(指令数* CPI)/时钟速率

but it doesn't work. 但这不起作用。 Here's the question: 这是问题:

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

Some insights on the correct answer and why it is obtained using that particular formula would be helpful. 对正确答案以及为何使用该特定公式获得答案的一些见解会有所帮助。 Thanks! 谢谢!

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

Now substitute and you will arrive at solution b. 现在替换,您将到达解决方案b。

A: 15 seconds = InsA * CPIA * ClockRate ClockRate = 15 seconds / (InsA * CPIA) 答: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 seconds / (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 seconds = 9.9 seconds TimeB = 0.6 * 1.1 * 15秒= 9.9秒

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

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