quantile: Use an if instead of math.Min
This significantly speeds up targeted streams when epsilon is small
because the invariant is called a lot.
benchmark old ns/op new ns/op delta
BenchmarkInsertTargetedSmallEpsilon 611 442 -27.66%
BenchmarkInsertTargeted 188 171 -9.04%
BenchmarkInsertBiasedSmallEpsilon 833 914 +9.72%
BenchmarkQuery 105 97.5 -7.14%
BenchmarkInsertBiased 176 172 -2.27%
BenchmarkQuerySmallEpsilon 6599 6500 -1.50%
Caleb Spare
9 years ago