当前位置:
文档之家› 执行时间(latency等待时间)
执行时间(latency等待时间)
1
Performance Measurement 1
Machine X is n% faster than Machine Y: 机器X比机器Y快 n%
n 100 Execution timeY Execution timeX PerformanceX PerformanceY
1
2
Performance Measurement 2
10
Amdahl’sLaw can also be be applied to compare Amdahl’s Law can also applied to compare two CPU design alternatives, for example : two CPU design alternatives, Implementations for example : of floating-point(FP)square root vary significantly in performance, especially among Implementations of floating-point(FP)FP processors designed for graphics. Suppose squareroot(FPSQR) is responsible for 20% of the square root vary significantly in performance, of a critical graphics processors execution time especially among benchmark. designed for is to enhance the FPSQR hardware One proposal graphics. and speed up this operation by a factor of 10. The Amdahl’s Law也可以用于比较两种设计不同的 other alternative is just to try to make all FP CPU,特别是对于处理图形的处理器来说,求浮点 instructions in the graphics processor run faster by 数平方根的不同实现方法在性能上有很大差异。 a factor of 1.6; FP instructions are responseible for a total of 50% of the execution time for the application. Compare these two design alternatives.
4
Make the Common Case Fast
Improving the frequent event, rather than the rare event, will obviously help performance.
Overflow case and no overflow case in addition
Performance Measurement 1
Performance
Execution time 执行时间(latency等待时间): Time between the start and the completion of an event 一个事件从开始到结束所经过的时间 Performance 1/(Execution time) 性能与执行时间成反比 Throughput吞吐量 (bandwidth带宽): Total amount of work done in a given time 给定时间内完成的全部工作
12
Answer: we can compare these two Answer: we by comparing these two alternatives can compare the speedups: alternatives by comparing the speedups: (可以通过计算加速比来进行比较)
15 10
1
50 100
3
n 50
Make the Common Case Fast
Perhaps the most important and pervasive principle of computer design is to make the common case fast: In making a design trade-off, favor the frequent case over the infrequent case. 计算机设计的最重要的原则就是:加快经常性发 生事件的执行速度。
7
Amdahl’s Law 3
Execution timenew fE = Execution timeold x ((1 fE ) ) sE where fE: fraction of enhancement sE: improvement gained by the enhancement mode 即:新的执行时间=
11
Amdahl’s Law canroot(FPSQR) is responsible for Suppose FP square also be applied to compare two 20% of the execution time of a critical graphics CPU design alternatives, for example : benchmark. One proposal is to enhance the FPSQR Implementations of floating-point(FP)square root hardware and speed up this operation by a factor of vary significantly in performance, especially all FP 10. The other alternative is just to try to make among instructions in the graphics processor run faster by a processors designed for graphics. Suppose FP factor of 1.6; FP instructions are responseible for the square root(FPSQR) is responsible for 20% of a total of 50% of the executiongraphics benchmark. execution time of a critical time for the application. Compare these two design alternatives.
Example: Machine A runs a program in 10 seconds, Machine B runs the same program in 15 seconds, A is __% faster than B.
1
n 100
Execution time B Execution time A
原来执行时间x ((1 增强比例)
增强比例 增强加速比
8
)
Amdahl’s Law 3
Speedup =
Execution timeold Execution timenew 1 (1 fE ) fE sE
即:加速比=原来的执行时间/新的执行时间 1 =
((1 增强比例) 增强比例 增强加速比 )
6
Amdahl’s Law 2
Speedup (加速比) = Performance for entire task using the enhancement when possible(改进后完成整个任务的性能) Performance for entire task w/o using the enhancement (改进前完成整个任务的性能) = Execution time for entire task w/o using the enhancement(改进前完成整个任务的时间) Execution time for entire task using the enhancement when possible (改进前完成整个任务的时间)
提高频繁事件的执行速度,而不是提高罕见事件 的执行速度,将带来明显的性情况
5
Amdahl’s Law 1
Amdahl’s Law states that the performance improvement to be gained from using some faster mode of execution is limited by the fraction of the time the faster mode can be used. 阿姆达定律表明:通过改进某模式得到的整 体性能提高,受限于该改进模式所占的运行 时间比例。
9
Amdahl’s Law 4
Example: An enhancement run 10 times faster than the original machine, but it is usable 40% of the time, then the speedup = __.
Sol:fE = 0.4 sE = 10 Speedup= 1/((1-0.4) + 0.4/10) = 1.56
SpeedupFPSQR 1
SpeedupFP
SpeedupFPSQR 1 0.2) 0.2 ) 1.22 (( 0.2 10 ) ((1 0.2) 10 1