Boss lesson · Unit 01
Find the bottleneck
Amdahl's law on a slow nightly job, from profile to fix
What you practise
- Speed up 5% of the run time by 10× and see what you gain (Amdahl's law worked)
- Profile, guess, fix, measure
- Knowing when to stop
Try a question from this lesson
Pick one
A nightly job, profiled by stage. A teammate makes format 10× faster. About how long does the whole job take now?
stage time share
load data 5 s 5%
match rows 80 s 80%
format 10 s 10%
write file 5 s 5%
total 100 sHint
Only one row of the table changes. What happens to the other three?
Correct answer
91 s
Why
Only the 10 s of formatting shrinks, to 1 s. The other 90 s are untouched: 91 s. A 10× speed-up of a 10% stage is a 9% speed-up of the job.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Amdahl's law
What a speed-up is worth depends on how much of the run it touches.
New time = untouched part + (sped-up part ÷ its speed-up)
The untouched part is a floor you cannot get under. If a stage is 10% of the run, making it infinitely fast saves 10% and no more.
So fix the biggest stage first, and work out the gain before you spend a week on it.
11 more exercises in the app
- 4× type the answer
- 4× multiple choice
- 1× order the lines
- 1× fill the blanks
- 1× true or false
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.