A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

CPU Performance Metrics and Amdahl's Law

College Depth 102 in the knowledge graph ☐ I know this ☆ Set as goal
3topics build on this
492prerequisites beneath it
See this on the map →
CPU PipeliningTime and Space Complexity→→Performance Metrics, Power, and Thermal ManagementSuperscalar and VLIW Processors
performance CPI MIPS Amdahls-law benchmarking

Core Idea

CPU performance is quantified by the equation: CPU time = Instruction count × CPI × Clock cycle time. Improving any one factor improves performance, but trade-offs exist — reducing CPI with more pipeline stages may require a faster clock with shorter cycle time. Amdahl's Law states that the speedup from improving a fraction f of execution is bounded by 1/(1−f), meaning serial portions of code form a hard ceiling on total speedup. Benchmarks like SPEC measure real-world application performance rather than synthetic peak numbers, providing honest cross-architecture comparisons.

How It's Best Learned

Compute execution time using the CPU time equation under different clock speeds and CPI assumptions. Apply Amdahl's Law to predict speedup from parallelizing 80% of a workload. Compare SPEC scores across processor generations to observe the effect of architectural improvements.

Common Misconceptions

Explainer

From your work with pipelining and algorithm complexity, you already have intuitions about what makes computation fast or slow. Performance and benchmarking formalizes these intuitions into a precise framework. The central equation is deceptively simple: CPU time = Instruction count × CPI × Clock cycle time. Every architectural decision maps onto one or more of these three factors. A better compiler reduces instruction count. A wider pipeline or out-of-order execution reduces CPI (cycles per instruction). A smaller transistor process enables a faster clock, reducing cycle time. The equation makes explicit that improving one factor while worsening another can result in no net gain — or even a regression.

CPI deserves special attention because it is not a fixed number — it is an average across all instructions in a program. A load instruction that hits in L1 cache might take 1 cycle, while the same load missing to main memory might stall for 200 cycles. A program dominated by cache-friendly arithmetic will have a CPI near 1 (or below 1 on a superscalar processor), while a pointer-chasing traversal of a linked list might have an effective CPI of 50 or more. This is why clock speed alone is misleading: a 4 GHz processor with CPI of 5 is slower than a 2 GHz processor with CPI of 1 on the same instruction count.

Amdahl's Law provides a ceiling on optimization. If you can speed up 90% of a program's execution by a factor of 10, the overall speedup is not 10× — it is only about 5.3×, because the remaining 10% is unchanged and now dominates execution time. The formula is Speedup = 1 / ((1 − f) + f/S), where f is the fraction improved and S is the speedup of that fraction. The practical lesson is harsh: optimizing what is already fast is nearly worthless. Profiling to find the actual bottleneck is always the first step, because Amdahl's Law guarantees that effort spent on non-bottleneck code yields diminishing returns.

Benchmarks exist because no single metric captures performance across all workloads. MIPS (millions of instructions per second) is seductive but flawed — it varies by program, ignores instruction complexity, and can even increase when a compiler generates more but simpler instructions. The SPEC benchmark suites (SPECint, SPECfp) address this by running standardized real-world programs and reporting geometric means of speedup ratios relative to a reference machine. When you see a processor advertised as "20% faster," the right question is always: faster on what benchmark, and does that benchmark resemble your workload?

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Assembly Language Basics → CPU Datapath → Instruction Fetch-Decode-Execute Cycle → CPU Control Unit → Microinstruction Format and Control Signals → Hardwired vs. Microprogrammed Control → Processor Control Unit Design → Finite State Machines in Processor Control → Single-Cycle Processor Architecture → Multi-Cycle Processor Design and Execution States → CPU Pipelining → CPU Performance Metrics and Amdahl's Law

Longest path: 103 steps · 492 total prerequisite topics

Prerequisites (2)

Leads To (2)