Chapter 63. When Are You Done?
When are you finished optimizing? Oh, that’s simple: you stop optimizing when further optimizing stops yielding sufficient benefit. But what does that mean?
One interpretation is that you’re done optimizing when everyone who uses the system is happy with its performance. This interpretation has some commonsense appeal; it’s harmonious with the old adage, “If it ain’t broke, don’t fix it.”
But think about Kevin’s invoicing story. What if they hadn’t had a problem at month-end, and invoicing took forty seconds year-round? Would invoicing then have been “just fine,” with no need to look at it any further? Even though Kevin’s business was willing to consider a forty-second invoice creation “satisfactory,” there was definitely business value to be had from improving it to less than a second.
Your standard of care should be better than just “everybody’s happy.” One reason is that happiness is subjective. Kevin’s company was “happy” with forty-second invoicing only because they assumed it was impermissible to ask for anything better. What you need is an objective way to determine when you’re done optimizing. And we have one:
Every important program should run at its “top speed.”
Every program has a top speed, a speed at which your program cannot be made faster without changing its hardware. You have reached a program’s top speed when:
-
It executes no unnecessary events (calls, instructions, etc.), and
-
Its events (calls, instructions, etc.) run at hardware ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access