[理工] [計組] 102中央資工 Performance

看板Grad-ProbAsk作者 (呱)時間9年前 (2016/11/21 12:40), 9年前編輯推噓9(9012)
留言21則, 5人參與, 最新討論串1/1
問題已解答,感謝各位 About the performance analysis ,which of the following statement(s) should be true ? A. Assume that a C program is compiled into 1000 machine instruction, which are related to the size of the executable file. Then, the average execution time is usually equal to multiplying 1000(instructions) by its average CPI and the clock cycle time. B. In evaluating the performance by using the benchmark tests , we usually use the geometric mean to calculate the average value among various test result. C. MIPS is not reliable metric since it provide the wrong result when we compare the performance of a compiled program running on two machine with the same instruction set architecture. D. It's usually a preffered approach to consider only one of the three factors: clock rate , CPI or the instruction count , and then try to improve it to decrease the execution time. That is called a divide-and-conquer methodology. E. None of above it . --   有一個香錦囊,是從一個神話般的守軍的血屍頂上剝下的。那一次我們部隊遭受從未 有過的頑強抵抗,我們犧牲了三個艦隊,一個裝甲師和無以數計小組推進的敢死排,才摧 毀了那處隘口的碉堡。但是竟然發現,使我們遭受如此慘烈傷亡的守軍,總數只有一人。   士兵們起鬨地在他胸前發現這枚香袋,大家都相信這是一枚具有神奇力量的護身符。 我們把他的頭顱砍斷,取下香袋,剝開,   裡面一張被血浸紅的宣紙竟用漢字娟娟秀秀四個整齊的楷書寫著-「盼君早歸。」 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.224.35.64 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1479703247.A.B72.html

11/21 12:50, , 1F
A我覺得是C語言基本上極少你的程式沒有call function, lo
11/21 12:50, 1F

11/21 12:50, , 2F
op, branch...等等 應該是不太可能1000個指令順順地執行
11/21 12:50, 2F

11/21 12:50, , 3F
一次就結束
11/21 12:50, 3F
這個選項大概是我最不確定的,但通常被Compiler過後應該稱為 「assmebly instruction」 吧@@? 是這個原因嗎?

11/21 12:52, , 4F
C就是如你所說 已經是compiled過的program所以指令一樣
11/21 12:52, 4F

11/21 12:52, , 5F
又用一樣的ISA 那不就是比電腦效能了(不只是mips應給是
11/21 12:52, 5F

11/21 12:53, , 6F
所有ISA都是這樣吧)
11/21 12:53, 6F

11/21 12:57, , 7F
D 我也不確定 但是看都only就不會選XD
11/21 12:57, 7F
因為還有其他 factor 可以影響吧? EX Clock Cycle time 等等之類的

11/21 13:11, , 8F
B敘述的做法是AM,D的做法不是divide and conquer
11/21 13:11, 8F
就某種程度而言 Execution Time 的公式IC * CPI * Clock cycle time 不也跟 Divide and conquer 很像嗎? 分開測量此三種 Factor 後結合 成一個解 Divid nad cnquer :將一個問題分成無數個小問題,解決各個小問題 大問題也跟著解決了

11/21 15:35, , 9F
D因為那三個因素會互相影響,要分治的前提是子問題不會
11/21 15:35, 9F

11/21 15:35, , 10F
互相影響
11/21 15:35, 10F

11/21 15:45, , 11F
推樓上, 洪逸上課有強調這點,用DP子問題才能互相影響.
11/21 15:45, 11F
大概能理解若 factor 互相影響則無法使用 Divide and conquer 可否舉例一些關於 CPI IC and CT 會互相影響的例子@@? 還是這裡是指因 Execution Time = 此三變數的乘積 因此不算此類呢?? 感謝

11/21 16:04, , 12F
舉個例子如果用更強指令可減少instruction count 但是
11/21 16:04, 12F

11/21 16:04, , 13F
可能會增加CPI或者選擇增加cycle time來完成一條指令
11/21 16:04, 13F

11/21 16:05, , 14F
11/21 16:05, 14F
感謝兩位大大解答,順便問A選項有甚麼看法

11/21 16:34, , 15F
我也不會QQ
11/21 16:34, 15F

11/21 17:09, , 16F
是total executed time才對~ 被騙了XD
11/21 17:09, 16F
改完顏色也突然看到 XD 應該是total 沒錯 感謝

11/21 17:21, , 17F
這樣很模糊內,一個C program的平均執行時間有錯嗎
11/21 17:21, 17F
通常不會談論 Average Execution time ,因為每個 Program 的 instruction 不太一樣,overhead、stall 等等都必須考量進去,「average」就有點不准了 剛剛看到某國外網址有人問同樣題目 https://goo.gl/XCZWYW 參考看看 ※ 編輯: ken52011219 (36.224.35.64), 11/21/2016 17:37:21

11/21 17:54, , 18F
他們大部分都是在說excution time錯,那改成CPU excutio
11/21 17:54, 18F

11/21 17:54, , 19F
n time不知道會不會對
11/21 17:54, 19F
感覺還是需要各種考量QQ

11/22 10:49, , 20F
所以答案應該是什麼呀霧颯颯
11/22 10:49, 20F

11/22 10:49, , 21F
答案為e 全錯 我補上好了
11/22 10:49, 21F
※ 編輯: ken52011219 (36.224.35.64), 11/22/2016 10:51:49
文章代碼(AID): #1OCdhFjo (Grad-ProbAsk)