Course contentsShow
← Computer Science
Lesson 1159 of 2,87227. Pipelining and PerformanceFree lesson

Pipeline Performance Metrics

Calculate CPI, IPC, and execution time for pipelined processors considering ideal and real-world conditions.

Pipeline Performance Metrics

You'll learn how to measure how well a pipelined processor performs using key metrics like CPI, IPC, and execution time.

Understanding Pipeline Performance

When we evaluate a pipelined processor, we need concrete numbers to judge its effectiveness. Three fundamental metrics help us do this:

CPI: Cycles Per Instruction

CPI tells you how many clock cycles it takes, on average, to complete one instruction. In an ideal pipeline with no delays, CPI = 1 (one instruction completes every cycle after the pipeline fills). In reality, hazards and stalls increase this number.

Formula: CPI = Total Cycles / Total Instructions

IPC: Instructions Per Cycle

IPC is simply the inverse of CPI. It measures throughput: how many instructions complete per clock cycle on average. Higher is better!

Formula: IPC = 1 / CPI = Total Instructions / Total Cycles

Execution Time

This is the actual wall-clock time to run a program.

Formula: Execution Time = Total Cycles × Clock Cycle Time

Or equivalently: Execution Time = Instructions × CPI × Clock Cycle Time

Real-World Conditions

In an ideal 5-stage pipeline running 1000 instructions:

  • Initial fill takes 4 cycles
  • Next 1000 cycles each complete one instruction
  • CPI = 1004/1000 ≈ 1.004 (nearly perfect!)

But with stalls from hazards, dependencies, or multi-cycle instructions:

  • If we have 200 stall cycles: CPI = 1204/1000 = 1.204
  • IPC drops to 1/1.204 ≈ 0.831

The execution time depends on both CPI and the clock speed—a deeper pipeline might reduce cycle time but increase CPI due to more hazards.

Key Takeaway: CPI, IPC, and execution time quantify pipeline efficiency; ideal pipelines achieve CPI ≈ 1, but real-world hazards and stalls degrade performance.