Professional Documents
Culture Documents
Amdahl's Law
Amdahl's law:
1-F
Diminishing returns
Limit on overall speedup
1 F F F
Overall speedup
F
1 F
Speedup
1-F
Corollary: make the
common case fast
F/Speedup
Illustrating Amdahl's Law
Example: implement cache, or faster ALU?
Cache improves performance by 10x
ALU improves performance by 3x
Depends on fraction of instructions
Suppose F mem 0.2, F alu 0.5, F other 0.3
1
Speedup with cache 1.22
0.80.2 10
1
Speedup with faster ALU 1.5
0.50.5 3
Example continued...
Fixing F alu 0.5 for what value of F mem is
adding a cache better?
1
1.5
1 F mem F mem 10
10
F mem 0.36
27
The CPU Performance Equation
CPU time Num. clock cyclesClock cycle time
OR
CPU time Num. of clock cyclesClock rate
For a program,
Num. of clock cycles
Instruction Count Cycles Per Instruction
IC CPI
Slower
5ns 10ns 100ns O(10ms)
Larger
200B 512KB 512MB O(10-100GB)
Cheaper
Modifying the CPU Performance
Equation
Caches involved hits and misses
Cache miss ==> memory stalls
CPU timeCPU clock cycles Memory stall cycles
Clock cycle
Memory stall cyclesNum. misses Miss penalty