Documentation
¶
Overview ¶
Package scaling checks in tests that work grows linearly with the input. It compares a run on n items with a run on 4n, so the verdict does not depend on how fast the machine is: linear work takes about 4 times as long, quadratic work 16 times.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Linear ¶
Linear fails the test when the work at 4n takes more than maxRatio times the work at n. setup builds the input for a size outside the timing and returns the work to time. Each size runs five times and the fastest run counts, so a pause in the machine does not decide the result. Pick n so the small run takes some milliseconds, or timer noise decides instead.
Types ¶
This section is empty.