AP® Computer Science Principles · Big Idea 4 · Topic 4.3
Calculating Speedup
Speedup compares how long a job takes running sequentially versus running in parallel. The parallel run time is set by the slowest piece, not the average piece, because every processor has to wait for the last one to finish.
Split a job across several processors and the whole thing finishes only when the last processor finishes. If three tasks take 10, 20, and 30 seconds and run at the same time, the job takes 30 seconds, not 20. Those 10 extra seconds the fast processors sit idle still count, because nobody can collect the final answer until every piece is done. That single slowest piece is called the bottleneck.
Real jobs also have a part that can't be split at all: reading in data, setting things up, combining results at the end. That part runs sequentially no matter how many processors you have. So parallel run time equals the sequential part plus the longest parallel task. Speedup is just a ratio: sequential time divided by parallel time. A speedup of 3 means the job got three times faster, nothing more.
This is why speedup almost never matches the processor count. Four processors sound like a 4x promise, but if the setup time is fixed and the four tasks are uneven sizes, the slowest one drags the whole job down and the setup time never shrinks at all. Perfect speedup, where n processors give exactly n times the speed, only happens when a job splits into perfectly equal pieces with zero sequential overhead. That almost never happens, which is why real systems chase good speedup, not perfect speedup, and why balancing the workload across processors matters as much as adding more of them.
Key terms
- Speedup
- The sequential run time divided by the parallel run time, showing how many times faster the parallel version is.
- Bottleneck
- The longest-running parallel task, which determines when the whole parallel portion of the job finishes.
- Sequential portion
- The part of a job that cannot be divided among processors and must run on its own.
- Perfect speedup
- The ideal case where speedup equals the number of processors, possible only with equal task sizes and no overhead.
Watch it explained
- How it worksHow does parallel run time come out as the sequential part plus the longest parallel task?
- Worked exampleFind the speedup when a job takes 60 seconds sequentially and 25 seconds in parallel.
- Worked exampleFind the parallel run time for tasks of 10, 20, 30, and 40 seconds after 15 seconds of setup.
- Common mistakeWhy isn't the speedup of a parallel job simply equal to the number of processors it runs on?
- Going furtherWhat changes about the speedup when the four parallel tasks are wildly unequal in size?
Check yourself
End of topic.