Computer Architecture: Performance
The Classic CPU Performance Equation in terms of instruction count (the number of instructions executed by the program), CPI, and clock cycle time: CPU time=Instruction count * CPI * Clock cycle time
CPU performance equation.
The Classic CPU Performance Equation in terms of instruction count (the number of instructions executed by the program), CPI, and clock cycle time: CPU time=Instruction count * CPI * Clock cycle time or since the clock rate is the inverse of clock cycle time:
CPU time = Instruction count *CPI / Clock rate
T = N X S / R
Performance A / Performance B = Execution time B / Execution time A = n
CPU execution time for a program
CPU execution time for a program = CPU clock cycles for a program * clock cycle time or since the clock rate is the inverse of clock cycle time:
CPU execution time for a program= CPU clock cycles for a program / Clock rate
CPU clock cycles required for a program
CPU clock cycles = Instructions for a program * Average clock cycles per instruction
Basic components of performance
The basic components of performance and how each is measured are:
Components of Performance
CPU execution time for a program
Clock cycles per instruction(CPI)
Clock cycle time
Units of measure
Seconds for the program
Instruction executed for the program
Average number of clock cycles per instruction
Seconds per clock cycle
CPU execution time for a program = CPU clock cycles for a program * Clock cycle time.
Factors affecting the CPU performance
The performance of a program depends on the algorithm, the language, the compiler, the architecture, and the actual hardware. The following list summarizes how these components affect the factors in the CPU performance equation.
1. Algorithm –affects Instruction count, possibly CPI
The algorithm determines the number of source program instructions executed and hence the number of processor instructions executed. The algorithm may also affect the CPI, by favoring slower or faster instructions. For example, if the algorithm uses more floating-point operations, it will tend to have a higher CPI.
2. Programming language - affects Instruction count,CPI
The programming language certainly affects the instruction count, since statements in the language are translated to processor instructions, which determine instruction count. The language may also affect the CPI because of its features; for example, a language with heavy support for data abstraction (e.g., Java) will require indirect calls, which will use higher-CPI instructions.
3. Compiler - affects Instruction count, CPI
The efficiency of the compiler affects both the instruction count and average cycles per instruction, since the compiler determines the translation of the source language instructions into computer instructions. The compiler’s role can be very complex and affect the CPI in complex ways.
4. Instruction set architecture - affects Instruction count, clock rate, CPI
The instruction set architecture affects all three aspects of CPU performance, since it affects the instructions needed for a function, the cost in cycles of each instruction, and the overall clock rate of the processor.
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.
Speedup= Performance for entire task using the enhancement / Performance for entire task without using the enhancement