IPC in the performance equation

Program run time equals instruction count times cycles per instruction (CPI) divided by clock frequency. IPC, instructions per cycle, is the reciprocal of CPI, so for a given program performance is proportional to IPC times frequency. A 3 GHz core has a cycle time of about 0.33 ns, but two 3 GHz processors can differ widely in speed because their IPC differs. IPC comparisons only make sense for the same program and instruction set, because different instruction sets need different numbers of instructions for the same work.

What raises IPC

A simple pipeline aims for one instruction per cycle. Superscalar cores issue several independent instructions per cycle, with high-performance designs about 6 to 10 wide. Out-of-order execution keeps those units busy by running later independent instructions while earlier ones wait, branch prediction avoids pipeline flushes, and large caches with prefetching hide memory latency. Width cannot grow freely: dependency-checking logic grows roughly with the square of the issue width, and real programs offer limited instruction-level parallelism, so achieved IPC stays well below the peak width.

What drags IPC down

The biggest losses are stalls. A last-level cache miss that goes to DRAM can cost hundreds of cycles, a branch misprediction discards work already in a deep pipeline, and chains of dependent instructions serialize execution. An IPC far below 1 on a wide core, such as 0.3, usually means the core spends most of its time waiting on memory; restructuring data for locality, reordering loops or blocking for cache reuse typically help more than any compiler flag. Raising clock frequency does not shorten memory latency in nanoseconds, so memory-bound code sees its IPC fall as frequency rises.

Measuring IPC

Many processors include a performance monitoring unit (PMU) with hardware counters for cycles, retired instructions, cache misses at each level, TLB misses and branch mispredictions. Dividing retired instructions by cycles gives IPC directly. Tools such as Linux perf read these counters while a program runs, and comparing IPC with miss and misprediction rates shows whether time is going to memory, branches or computation. Because many CPUs constantly change frequency with load and temperature, counting cycles rather than wall-clock time gives a cleaner view of microarchitectural efficiency.

Try it: questions about IPC

Performance counters show a program's IPC is very low at 0.3, with many last-level cache misses. Which pairs the likely situation with a remedy?

  1. AThe CPU spends much time stalled on memory; change data layout or apply blocking to use caches effectively
  2. BComputation is too fast; raise the frequency
  3. CThere are too few branches; add more
Show answer and explanation

Answer: A. The CPU spends much time stalled on memory; change data layout or apply blocking to use caches effectively

Many CPUs can execute several instructions per cycle, so an IPC of 0.3 means they are waiting most of the time. Many last-level cache misses suggest long waits for data from main memory. Effective remedies reduce cache misses: laying data out at consecutive addresses, reordering loops, or blocking so data is reused many times.

FAQ

Is a higher clock speed or a higher IPC better?

Performance depends on their product, so neither alone decides speed. A lower-clocked core with much higher IPC can outperform a faster-clocked one on the same program.

How do I measure the IPC of my program?

Use hardware performance counters, for example with Linux perf, to count retired instructions and cycles; IPC is instructions divided by cycles. Cache-miss and branch-miss counts then help explain a low value.

What does a low IPC mean?

It means the core is idle for many cycles, most often waiting for data from memory after cache misses, or recovering from branch mispredictions and long dependency chains.

Questions that mention IPC (5)

IPC appears in 6 practice questions across 3 topics, including CPUs and architecture, Performance Analysis, How to read datasheets.

  1. Which is the correct handling of a surface-mount part marked MSL 3 (moisture sensitivity level 3)?
  2. What is the processor design called that issues and executes multiple instructions simultaneously in one clock cycle?
  3. Which metric indicates the number of instructions executed per clock?
  4. Which correctly describes a CPU with a clock frequency of 3 GHz?
  5. Which is an example of what CPU performance counters (the PMU) can count?

Books on CPUs and architecture Ad

As an Amazon Associate I earn from qualifying purchases.

Comparisons that include this term

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary