简体   繁体   中英

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. 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

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.

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

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

TimeB = 0.6*1.1*15 seconds = 9.9 seconds

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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