6.1.3 · D2Parallelism & Multicore

Visual walkthrough — Amdahl's Law and Gustafson's Law

2,142 words10 min readBack to topic

This page assumes nothing except that you can measure time. Related ideas live in Scalability Analysis, Performance Metrics, Parallel Architectures, and Load Balancing — but you do not need them yet. Prefer Hindi? Yeh note Hinglish mein →.


Step 1 — Draw the work as a bar of time

WHAT. A program runs. It takes some amount of time. Draw that time as a horizontal bar. The length of the bar is how long the job takes — nothing more. Call that total time .

  • — the 1 means "on one processor". It is the time our single worker takes to finish the whole job, start to end.

WHY. Before we can talk about "going faster", we need a picture of what "the work" even is. A bar is the honest picture: time flows left to right, and the whole job is the whole bar. Everything else on this page is us cutting and shrinking this bar.

PICTURE. The full bar below is . Right now it is one solid colour — we have not yet split it into parts.

Figure — Amdahl's Law and Gustafson's Law

Step 2 — Split the bar into serial and parallel parts

WHAT. Not all work is equal. Some of it must happen in a fixed order — like reading a file before you can process it, or acquiring a lock. That part is called serial. The rest can be chopped into independent pieces worked on at the same time — that part is parallel.

We cut the bar into two coloured segments:

  • — the serial fraction. It is a number between and : what portion of the total time is stuck being sequential. If , then one-fifth of the bar is serial.
  • — the fraction times the total time = the actual length of the serial segment in seconds.
  • — "everything that is not serial", so this is the parallel fraction.
  • — the length of the parallel segment in seconds.

WHY. This split is the entire idea behind both laws. The serial piece is the villain — we cannot speed it up by adding workers. The parallel piece is the hero — it shrinks when we add workers. To reason about speedup we must first name and colour these two enemies.

PICTURE. The magenta chunk is serial (frozen, never shrinks). The orange chunk is parallel (the part we will attack). Notice their lengths add back up to the full bar.

Figure — Amdahl's Law and Gustafson's Law

Step 3 — Add processors and shrink only the parallel part

WHAT. Now bring in processors ( workers). Hand the parallel work to all of them at once. If the work divides perfectly, workers finish it in of the time. The serial part still runs on one worker — it does not shrink at all.

The new total time on processors is:

  • — the number of processors. means one worker (back to ); big means a big crowd.
  • — take the parallel segment and divide its length by . Twice the workers → half the parallel time. Ten workers → one-tenth.
  • The serial term has no in it — that is the whole tragedy. More workers cannot touch it.

WHY. This is the honest model of adding cores: the divisible work divides, the stubborn work stays. Everything about Amdahl's pessimism comes from that one term with no .

PICTURE. The magenta (serial) block is exactly as long as before. The orange (parallel) block has been squeezed to of its width. Watch how the serial block now dominates the shrunken bar.

Figure — Amdahl's Law and Gustafson's Law

Step 4 — Define speedup as a ratio of bar lengths

WHAT. "How much faster did we get?" is answered by comparing the two bars: the old length divided by the new length. Call that ratio speedup .

  • — speedup. means "four times faster than one processor".
  • Numerator — the original bar length.
  • Denominator — the shrunken bar length.

WHY. Speedup must be a ratio, because "faster" is always relative. A ratio also lets us cancel the units (seconds) — we care about the factor, not the raw seconds. That cancellation is the next step and it is beautiful.

PICTURE. Two bars stacked: the long original on top, the short below. The red bracket shows the ratio — how many copies of the short bar fit inside the long one.

Figure — Amdahl's Law and Gustafson's Law

Step 5 — Cancel to get Amdahl's Law

WHAT. Every term in the fraction carries a . Factor it out of the bottom and cancel it against the top. The absolute time vanishes.

  • The on top and the factored out below cancel — leaving a clean on top.
  • Bottom: (the frozen serial share) plus (the shrinking parallel share).

WHY. Cancelling tells us something deep: speedup does not depend on how big the job is — only on the fraction and the worker count . A 3-second job and a 3-hour job with the same scale identically.

PICTURE. The symbols on top and bottom glow, then cross out; what remains is a formula built only from and .

Figure — Amdahl's Law and Gustafson's Law

Step 6 — Push to infinity: the ceiling

WHAT. What is the best you could ever do with unlimited processors? Let grow without bound. The term has in its denominator, so as gets huge this term shrinks to zero. Only survives.

  • — "watch what happens as becomes enormous". We use a limit here because we want the ceiling — the value the curve flattens toward but never crosses.
  • — a fixed number divided by an ever-bigger number heads to zero.
  • Result — a hard wall. If , the ceiling is . A million cores cannot beat it.

WHY. We use a limit because "infinitely many processors" is exactly the question a limit answers: what value do we approach? This is the single most important consequence of the whole derivation — the serial fraction sets an unbreakable ceiling.

PICTURE. The speedup curve climbs, then bends and flattens against a dashed horizontal line at height . It hugs the ceiling forever without touching it.

Figure — Amdahl's Law and Gustafson's Law

Step 7 — Degenerate cases: the two extremes

WHAT. Always check the boundaries, so no reader hits a surprise.

  • (nothing serial). Formula: . Perfect linear speedup — 8 cores give exactly . The bar is all orange; it shrinks fully.
  • (all serial). Formula: . No speedup ever. The bar is all magenta; adding workers does literally nothing.
  • (one worker). . Sanity check: one processor is, by definition, exactly as fast as itself.

WHY. These extremes are the anchor posts of the whole formula. If a formula behaves sensibly at , , and , you can trust it in between. They also show the two personalities of every program: fully parallel (dream) vs fully serial (nightmare).

PICTURE. Three little bars side by side — all-orange (), all-magenta (), and a single-worker bar — each labelled with the speedup it produces.

Figure — Amdahl's Law and Gustafson's Law

Step 8 — Gustafson's flip: measure from the parallel run

WHAT. Amdahl asked "same job, how much faster?" Gustafson asks the opposite: "same time, how much MORE work?" The trick is to start from the parallel run and imagine forcing it back onto one core.

Start with a job that fills processors in time , split as before:

Now redo that same amount of work on one processor. The serial part is unchanged, but the parallel part — which cores chewed through together — would take times longer alone:

Speedup is again the ratio, and cancels:

  • — the key move: the parallel work that cores did in time would take that on one core.
  • — grows almost linearly with when is small.

WHY. In real supercomputing we don't shrink the runtime — we grow the problem (finer weather grid, bigger neural net) to fill the new cores in the same wall-clock time. Gustafson measures that. The serial part now stays a fixed slice of the fixed runtime, so it no longer imposes a ceiling — that is why big machines feel worth it.

PICTURE. Left: the parallel bar (fixed time , small serial slice). Right: the same work stretched onto one core — the orange parallel block explodes to times its width while magenta stays put.

Figure — Amdahl's Law and Gustafson's Law

The one-picture summary

Two bars tell the whole story. Amdahl keeps the job fixed and shrinks time — the frozen serial slice grows to dominate, so speedup slams into the ceiling . Gustafson keeps time fixed and grows the job — the serial slice stays a small fixed share, so speedup climbs almost like .

Figure — Amdahl's Law and Gustafson's Law
Recall Feynman retelling — say it like a story

Imagine a job as a bar of coloured time. One colour (magenta) is stubborn work that must go in order; the other (orange) can be shared. Add workers and only the orange shrinks — the magenta just sits there. Speedup is just the old bar length divided by the new one. When you cancel the length, you learn speedup depends only on the fractions, not the size. Send in infinitely many workers and the orange vanishes entirely, but the magenta remains, capping you at forever — that's Amdahl. Then flip your question: don't ask "how much faster on the same job", ask "how much bigger a job in the same time". Now the stubborn part is a fixed sliver of a fixed clock, and the shareable part balloons with every worker — so speedup climbs almost straight up. That's Gustafson. Same two colours, two different questions, two different destinies.

Recall Quick self-test

With and , Amdahl speedup? ::: Same and , Gustafson speedup? ::: Amdahl ceiling for ? ::: At , Amdahl equals? ::: exactly (perfect linear speedup) At , Amdahl equals? ::: exactly (no speedup, all serial)