Ch1
约 160 个字 预计阅读时间 1 分钟
正在努力更新!
衡量计算机的性能
-
执行时间
- “X is n time faster than Y”
- \(Performance\ e_X/ Performance\ e_Y=Execution\ time_Y/Execution\ time_X=n\)
-
系统时钟(CPU Clocking)
- Clock period: duration of a clock cycl
- Clock frequency (rate): cycles per second
- \(CPU\ Time=CPU\ Clock\ Cycles \times Clock\ Cycle\ Time=\frac{CPU\ Clock\ Cycles}{Clock\ Rate}\)
- 提升性能
- 减少clock cycles数
- 增加clock rate
- Hardware designer must often trade off clock rate against cycle count (时钟频率高了,做一个任务cycle count会增加,而cycle count降低到一定程度就不降低)
- 指令数和CPI(cycles per instruction)
- \(CPU\ Time=Instruction\ Count\times CPI\times Clock\ Cycle\ Time\)
- Average cycles per instruction
- Determined by CPU hardware
- If different instructions have different CPI
- Average CPI affected by instruction mix