- This is from 1.6 of the book.
- The Defining Performance section (p 29) always gives me a moment of pause.
- Just exactly what do you mean by performance?
- Are you moving one person or 1000
- Are there any other ways you might measure performance for airplanes?
- What if you needed to move people 10,000 miles?
- We often fall into the trap that clock speed = better performance.
- But a far better measure of performance is execution time.
- For our program
- On our data.
- They define performance for a computer x as
1
PerformanceX = ---------------
Execution TimeX
- So if computer X runs a program faster than computer Y.
Execution TimeX < Execution TimeY
OR
1 1
--------------- > ---------------
Execution TimeX Execution TimeY
OR
PerformanceX > PerformanceY
- Example, A single cycle wombat computer with a clock speed of 2.63 MHz runs a program in 3.80 seconds, A multi cycle version with a clock speed of 8.33 MHz runs the same program in 3.94 seconds. What is the performance of each and how many times faster is the multi cycle version than the single cycle versions?
Execution Timesingle = 3.80
Execution Timemulti = 3.94
Performancesingle = 1/3.8 = .263
Performancemulti = 1/3.94 = .254
The single cycle machine has a higher performance since Performancesingle > Performancemulti
The single cycle machine is 1.04 times faster since .263/.254 ≈ 1.04
- Measuring performance is difficult
- I/O depends on activity
- The number of users and processes each is running has an impact
- Other OS processes impact wall clock time.
- So wall clock time is not a real measure.
- As we did with WOMBAT, we will concern ourselves with CPU time,
- The other factors are outside of the scope of this class.
- As we did with WOMBAT, we are mostly concerned with cycles per instruction.
- A sort of holy grail of processors is to have a CPI of 1.0
- Most of these types of problems can be solved with dimensional analysis.
- If processor A has a clock rate of 2GHz and a CPI of 1.3, and processor B has a clock rate of 2.5GHz and a CPI of 1.7, which processor has the better performance. Assume both processors have the same instruction set.
Since the processors have the same instruction set, we can assume
that programs have the same number of instructions.
Processor A
1.3 cycles 1 second
Time = n instructions x ----------- x ----------------
instruction 2.0 x 109 cycles
1.3n
= --------------- seconds
2.0 x 109
= .65n x 10-9 seconds.
Processor B
1.7 cycles 1 second
Time = n instructions x ----------- x ----------------
instruction 2.5 x 109 cycles
1.7n
= --------------- seconds
2.5 x 109
= .68n x 10 -9 seconds.
Processor A has the shorter execution time,
therefore it has the better performance.
- Assume a processor running at 3.0GHz has an instruction set which can be divided into three classes. Class A is used 25% of the time and has a CPI of 1, class B is used 45% of the time and has a CPI of 2, Class C is used 30% of the time and has a CPI of 4. If a program with 5.4x107 instructions is executed
- As they point out on page 39, multiple items impact the performance of a program.
- Algorithm has an impact on instruction count and CPI (instruction mix)
- The language used impacts both of these.
- The compiler has an impact on both of these.
- The CPU has an impact on all three.