]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] runtime: simplify histogram buckets considerably
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 21 Jan 2022 06:52:43 +0000 (06:52 +0000)
committerDmitri Shuralyov <dmitshur@golang.org>
Fri, 18 Feb 2022 00:27:35 +0000 (00:27 +0000)
commit1ba25fa28871cd3862f8d539155a60e004b42d56
tree9de2c474359e52d75727c7ebf7b1f1398373a96d
parent7d70adf3f5dbfdcab0d09b65b686a69359f248df
[release-branch.go1.17] runtime: simplify histogram buckets considerably

There was an off-by-one error in the time histogram buckets calculation
that caused the linear sub-buckets distances to be off by 2x.

The fix was trivial, but in writing tests I realized there was a much
simpler way to express the calculation for the histogram buckets, and
took the opportunity to do that here. The new bucket calculation also
fixes the bug.

For #50732.
Fixes #50734.

Change-Id: Idae89986de1c415ee4e148f778e0e101ca003ade
Reviewed-on: https://go-review.googlesource.com/c/go/+/380094
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
(cherry picked from commit 2e9dcb508647dc473a37ecfa244d2bc4a1843ab4)
Reviewed-on: https://go-review.googlesource.com/c/go/+/384621
TryBot-Result: Gopher Robot <gobot@golang.org>
src/runtime/export_test.go
src/runtime/histogram.go
src/runtime/histogram_test.go