Performance Analysis

A program's instruction mix is 50% integer ALU (CPI 1), 30% loads and stores (CPI 2) and 20% branches (CPI 5). What is the average CPI?

  1. A2.1
  2. B2.67
  3. C8
Show answer and explanation

Answer: A. 2.1

Average CPI is the sum of each instruction class's CPI weighted by its share of the mix: 0.5 × 1 + 0.3 × 2 + 0.2 × 5 = 0.5 + 0.6 + 1.0 = 2.1. Here branches are only 20% of instructions yet account for nearly half the total CPI. Seeing which instruction classes consume the most time points to where improvement should focus.

  • A. Correct. 0.5 × 1 + 0.3 × 2 + 0.2 × 5 = 2.1.
  • B. That simply averages the CPI values without weighting.
  • C. That just adds the CPI values.
Practice this topic Back to topic

More Performance Analysis questions

  1. When comparing CPU performance by instructions executed per second (millions of instructions per second), what should be kept in mind?
  2. How is speedup, which expresses a performance improvement, calculated?
  3. A part taking 50% of total time is made 4× faster. What is the overall speedup (Amdahl's law)?
  4. You want to make an entire task 2× faster by speeding up only the part that takes 60% of the time. How many times faster must that part become?
  5. Which lesson about how to approach performance improvement follows best from Amdahl's law?