Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #275 Benchmarks haven't changed significantly, despite the additional step to retrieve the hot counts during Observe, and the more involved Write. (Write is a bit slower now, but note that Write is supposed to be a relatively rare operation and thus not in the hot path compared to Observe.) Allocts haven't changed at all. OLD: BenchmarkHistogramWithLabelValues-4 10000000 151 ns/op 0 B/op 0 allocs/op BenchmarkHistogramNoLabels-4 50000000 36.0 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve1-4 50000000 28.1 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve2-4 10000000 160 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve4-4 5000000 378 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve8-4 2000000 768 ns/op 0 B/op 0 allocs/op BenchmarkHistogramWrite1-4 1000000 1589 ns/op 896 B/op 37 allocs/op BenchmarkHistogramWrite2-4 500000 2973 ns/op 1792 B/op 74 allocs/op BenchmarkHistogramWrite4-4 300000 6979 ns/op 3584 B/op 148 allocs/op BenchmarkHistogramWrite8-4 100000 10701 ns/op 7168 B/op 296 allocs/op NEW: BenchmarkHistogramWithLabelValues-4 10000000 152 ns/op 0 B/op 0 allocs/op BenchmarkHistogramNoLabels-4 30000000 39.2 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve1-4 50000000 29.4 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve2-4 10000000 163 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve4-4 5000000 347 ns/op 0 B/op 0 allocs/op BenchmarkHistogramObserve8-4 2000000 684 ns/op 0 B/op 0 allocs/op BenchmarkHistogramWrite1-4 1000000 1807 ns/op 896 B/op 37 allocs/op BenchmarkHistogramWrite2-4 500000 3321 ns/op 1792 B/op 74 allocs/op BenchmarkHistogramWrite4-4 200000 7087 ns/op 3584 B/op 148 allocs/op BenchmarkHistogramWrite8-4 100000 15366 ns/op 7168 B/op 296 allocs/op Signed-off-by: beorn7 <[email protected]>
- Loading branch information