The Classic CPU Performance Equation


The basic performance equation can therefore be written in terms of

CPU times = Instruction count × CPI × Clock cycle time
or, since the clock rate is the inverse of clock cycle time:
   CPU times = ( Instruction count × CPI ) / Clock rate

Computing CPU Time
Consider two different implementations, P1 and P2, of the same instruction set architecture. There are three classes of instructions, A, B, and C. The clock rate and CPI of each implementation are given in the following table:

Clock Rate CPI Class A CPI Class B CPI Class C
P1 2.0 GHz 1 2 3
P2 1.5 GHz 2 2 2

Given a program with 104 instructions divided into classes as follows: 30% class A, 30% class B, and 40% class C, which implementation is faster?  




      It’s not what you say out of your mouth that determines your life,    
      it’s what you whisper to yourself that has the most power!    
      ― Robert T. Kiyosaki