簡體   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