6.1.3 · D1Parallelism & Multicore

Foundations — Amdahl's Law and Gustafson's Law

1,863 words8 min readBack to topic

Before you can read a single line of the parent note, you need to earn every symbol it throws at you. Below, each symbol appears in the order it is built on the previous one. We never use a letter before it has a plain meaning and a picture.


1. Work and time — the picture of a job

Imagine a job as a long horizontal bar. The length of the bar is how long the job takes. That length has a name.

We care about two specific times, so we tag with a little number below it (a subscript).

Figure — Amdahl's Law and Gustafson's Law

Why do we need two names? Because "speedup" (coming soon) is a comparison between them. You cannot compare one thing to itself — you need and .


2. Processors — what counts

Why a whole number and not a fraction? You can't have half a processor. But in the formulas we still let grow without bound to ask "what's the absolute ceiling?" — that's the notation, read "as goes to infinity."


3. Splitting the bar — the serial fraction

Here is the heart of everything. Take the bar and cut it into two coloured pieces.

Figure — Amdahl's Law and Gustafson's Law

Now we measure what proportion of the bar is coral. That proportion is the single most important symbol in the topic.

Because the whole bar is (i.e. ) and the coral part is , the mint part must be whatever is left over:

Why write instead of a new letter like ? Because they always add to , giving them two independent letters would hide the fact that they're two halves of the same bar. One letter tells the whole story.


4. Slicing the mint piece — dividing by

When workers share the parallel (mint) work, each does of it, so it finishes times sooner.

Figure — Amdahl's Law and Gustafson's Law

Why does the serial part refuse to shrink? Because "serial" is defined as work that cannot be split. Dividing it by would contradict its own definition. This stubborn coral floor is the entire reason Amdahl's Law has a ceiling.


5. Speedup — the ratio

We finally compare the two bars. "How many times faster?" is a ratio.

Why a ratio and not a difference like ? A difference is in seconds and depends on the size of the job. A ratio is a pure number — "2.5×" means the same thing whether the job took milliseconds or hours. That portability is why performance is always quoted as speedup.


6. The limit symbol — finding the ceiling

Why do we bother with infinity when no computer has infinite cores? Because it reveals the hard ceiling. If , no amount of hardware ever beats . Knowing the ceiling stops you wasting money on cores that can't help.


7. Reading Gustafson's rearrangement

Gustafson's formula uses the same symbols but in a new shape. Every piece is already defined:

  • — processors (Section 2),
  • — serial fraction (Section 3),
  • — read "one fewer than "; it appears because Gustafson compares the parallel work at scale ( times bigger) against a single worker doing all of it.
Recall Why does Gustafson give a bigger number than Amdahl?

Because Amdahl keeps the same mint slice and shrinks its runtime, while Gustafson lets the mint slice grow with . Same symbols, different assumption about whether the problem grows.


Prerequisite map

Execution time T

Subscripts T1 and Tn

Processor count n

Split bar into serial and parallel

Serial fraction f

Parallel fraction 1 minus f

Divide parallel part by n

Speedup S of n

Limit as n goes to infinity

Amdahl ceiling one over f

Gustafson scaled speedup

Each box on the left must be solid before the topic (right side) makes sense. If any left box is fuzzy, re-read its section above.

Related deep material once you're ready: Performance Metrics, Scalability Analysis, Parallel Architectures, Load Balancing, Thread Synchronization, Cache Coherence, and GPU Computing.


Equipment checklist

Test yourself — cover the right side and answer aloud.

What does mean and how does it differ from ?
is the runtime on one processor; is the runtime on processors. The subscript is a label, not multiplication.
What is , and can it be a fraction?
The number of processors/workers; it is a whole number, though we let it grow to infinity to find limits.
In words, what is ?
The fraction of total execution time (not code) that is serial — must run one step at a time.
Why does the parallel part equal ?
Serial plus parallel make the whole bar, which is ; so parallel is whatever's left, .
Why does dividing by only touch the parallel part?
Only parallel work can be shared among workers; serial work is defined as un-splittable, so it stays fixed.
What does measure, and why a ratio?
How many times faster the job runs, ; a ratio is a pure number independent of job size.
What does ask?
The best-possible speedup as workers grow without bound — for Amdahl it settles at .
Why is "8 cores means 8× faster" usually wrong?
Because the serial fraction is nonzero, so the coral part caps the speedup below .