Performance Analysis

Which is the basic formula for a program's CPU execution time?

  1. AExecution time = instruction count + CPI + clock frequency
  2. BExecution time = clock frequency × instruction count
  3. CExecution time = instruction count × CPI (average cycles per instruction) × cycle time
Show answer and explanation

Answer: C. Execution time = instruction count × CPI (average cycles per instruction) × cycle time

Execution time is the product of the number of instructions executed, the average cycles per instruction (CPI) and the cycle time (clock period = 1 ÷ frequency). Instruction count is mainly set by the algorithm, compiler and ISA, CPI by the microarchitecture and cache misses, and cycle time by circuit and process technology. Improving performance means deciding which of the three to improve and by how much.

  • A. It is a product, not a sum.
  • B. Higher frequency shortens time, so it divides rather than multiplies.
  • C. Correct. It is the product of three factors.
Practice this topic Back to topic

More Performance Analysis questions

  1. A program executing 1 billion instructions runs on a CPU with average CPI 2 and clock frequency 2 GHz. What is the execution time?
  2. A CPU design change raises clock frequency 1.5× but also raises CPI 1.2× (instruction count unchanged). How many times faster is execution?
  3. A new compiler optimization reduces executed instructions by 20% but increases average CPI by 10% (frequency unchanged). What is its effect?
  4. 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?
  5. When comparing CPU performance by instructions executed per second (millions of instructions per second), what should be kept in mind?