Definition
A contrast is a stated comparison between a value measured under the condition being tested and the value under a reference condition, called the baseline: either their difference, in the measurement’s unit, or their ratio, which has no unit. Normalization divides values by a reference value, so that the reference becomes 1 and results on different scales can be compared. Percent overhead is the extra cost under the tested condition as a percentage of the baseline cost. Each of these numbers means something only when its baseline is named.
Where it fits
Main entry: Effect size (§11.24).
The effect size entry states the size of a difference in three forms: absolute, relative and standardized. This entry covers the relative forms and the words used for them. Let be the baseline value and the new value, both positive and in the same unit, such as latencies in milliseconds.
Absolute difference: . A negative value means that the new value is smaller.
Ratio, also called the normalized value: . A value below 1 means that the new value is smaller.
Speedup, used for durations: . A value above 1 means that the new version takes less time.
Percent change: . A positive percent change of a cost is its percent overhead. The percent reduction is , the percent change with its sign reversed.
Take milliseconds and milliseconds. The absolute difference is milliseconds, the ratio is , the speedup is and the percent change is . Measured against the new value instead, the old value is larger. Both percentages are correct; they divide by different values. For an overhead, take a baseline of 40 microseconds and 46 microseconds under the tested condition. The percent overhead is , and the normalized value is .
Normalized values need care when they are averaged. Suppose system A takes 2 seconds on workload 1 and 1 second on workload 2, and system B takes 1 second and 2 seconds. Normalized to B, the ratios of A are and , and their ordinary average is : A looks 25% slower. Normalized to A, the ratios of B are 0.5 and 2, with the same average 1.25: B looks 25% slower too. The geometric mean §11.39, , gives the same answer in both directions: neither system is slower, because the geometric mean treats a doubling and a halving as equal and opposite.
Limits and common mistakes
A small error in a small baseline becomes a large error in the ratio. Suppose the tested condition takes 3 microseconds and the true baseline 2 microseconds, an overhead of . If the baseline is measured 1 microsecond too short, the overhead becomes . A baseline of 0 gives no ratio at all.
Name the denominator of every overhead. A cost of 5 microseconds is of a 10-microsecond function, but of a 1000-microsecond operation that contains that function.
Percent changes do not add. An increase of 50% followed by a decrease of 50% leaves of the starting value. A change in a quantity that is itself a percentage is stated in percentage points: a loss rate that rises from 10 to 12% rises by 2 percentage points, a relative increase of .
Averaging the ratios of single runs and dividing two totals give different answers; the entry on the ratio of aggregates versus aggregate of ratios §11.40 explains when each one is right.
Questions answered
What does times smaller mean?
A writer who says that a new value is times smaller than an old value, for a number greater than 1, usually means that the new value equals the old value divided by , but the phrase has no agreed arithmetic meaning and should be replaced by an explicit ratio. Read literally, it would mean the old value minus times the old value, which is negative for any greater than 1. The mirror phrase is ambiguous too: some readers take “3 times larger” to mean 3 times the old value, and others the old value plus 3 times the old value, which is 4 times it.
Write instead “the new latency is of the old latency” or “old divided by new is ”. For an old latency of 10 milliseconds and , the new latency is milliseconds, a percent reduction of . For the reduction is , and for it is 99%, so equal factors of 10 look like ever smaller percentage gains. Give the absolute difference as well, here milliseconds, so that the reader can judge whether the change matters.
Related entries: Ratio of aggregates versus aggregate of ratios (§11.40), Geometric mean (§11.39), Logarithmic axes and multiplicative differences (§18.1.12).