Topics in This Course ..: BITS Pilani, Pilani Campus
Topics in This Course ..: BITS Pilani, Pilani Campus
Performance Indices
CPU time
– doesn't count waiting for I/O or time spent running other programs
– can be divided into user CPU time and system CPU time (OS
calls) CPU time = user CPU time + system CPU time
elapsed time = user CPU time + system CPU time + wait time
Our focus:
user CPU time (CPU execution time or, simply, execution time)
time spent executing the lines of code that are in our program
PerformanceX / PerformanceY = n
tick
equivalently
4th
5th
6th
...
time
time
Clock cycles(A)=40x109
6=1.2x 40x109/Clock rate(B)
Clock rate (B)=8GHz
B I 600ps 1.2
CPU Time
CPU Time I 500ps …by this much
A
CPI in More Detail
If different instruction classes take different
numbers of cycles
n
Clock Cycles (CPIi Instruction Count i )
i1
Relative
frequency
CPI Example
Alternative compiled code sequences using
instructions in classes A, B, C
Class A B C
CPI for class 1 2 3
IC in sequence 1 2 1 2
IC in sequence 2 4 1 1
Sequence 1: IC = 5 Sequence 2: IC = 6
Clock Cycles Clock Cycles
= 2×1 + 1×2 + 2×3 = 4×1 + 1×2 + 1×3
= 10 =9
Avg. CPI = 10/5 = Avg. CPI = 9/6 = 1.5
2.0
Performance Summary
Performance depends on
Algorithm: affects IC, possibly CPI
Programming language: affects IC, CPI
Compiler: affects IC, CPI
Instruction set architecture: affects IC, CPI, Tc
Benchmarks
Performance best determined by running a real application
– use programs typical of expected workload
– or, typical of expected class of applications
e.g., compilers/editors, scientific applications, graphics, etc.
Benchmark suites
– Perfect Club: set of application codes
– Livermore Loops: 24 loop kernels
– Linpack: linear algebra package
– SPEC: mix of code from industry organization
n
n
Execution time ratio
i1
i