Chapter 68. Linear Behavior
Imagine a profile as a spreadsheet, where the total duration for a line is the product of the execution count and the mean duration per execution:
A |
B |
C |
D |
|
1 |
Event |
Duration |
Executions |
Mean dur/exec |
2 |
A |
=C2*D2 |
? |
? |
3 |
B |
=C3*D3 |
? |
? |
4 |
C |
=C4*D4 |
? |
? |
5 |
Total |
=SUM(B2:B4) |
=SUM(C2:C4) |
=B5/C5 |
This is an easy way to see why there are only two ways you can make something go faster:
-
You can reduce an execution count (a value in column C); or
-
You can reduce a mean duration per execution (a value in column D).
Because each value in column B is the product of its row-mates in columns C and D, it’s easy to see what will happen if you change one of the input values. For example:
-
If you multiply the value of cell C2 by 0.2, then the value of cell B2 will become 0.2 times its original value.
-
If you cut D3 to 0.09 times its original value, then B3 will drop to 0.09 times its original value.
-
If you multiply C4 by 0.50 and D4 by 0.33, then B4 will become 0.50 × 0.33 times its original value.
And of course, each of these changes will propagate into the sum in cell B5.
Predicting the answers to what-if questions this way is simple. The only trick is knowing what changes to make to the shaded region of the worksheet. Sometimes, because of skew, interdependencies, and queueing, the numbers you’ll choose for your prediction may not be as obvious as you’d think.
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