diff options
author | Raul Silvera <rsilvera@google.com> | 2015-09-14 14:03:45 -0700 |
---|---|---|
committer | Minux Ma <minux@golang.org> | 2015-10-05 08:15:09 +0000 |
commit | 27ee719fb32b47b9bc59921e457f4b1e7f767968 (patch) | |
tree | 61845f2dc10b387dac8b4fe5c4ff7b5ae6fd4ad4 /src/runtime/fastlog2table.go | |
parent | 0357c38adfd5d368390d82a2ab5b32748e4bb549 (diff) | |
download | go-27ee719fb32b47b9bc59921e457f4b1e7f767968.tar.gz go-27ee719fb32b47b9bc59921e457f4b1e7f767968.zip |
pprof: improve sampling for heap profiling
The current heap sampling introduces some bias that interferes
with unsampling, producing unexpected heap profiles.
The solution is to use a Poisson process to generate the
sampling points, using the formulas described at
https://en.wikipedia.org/wiki/Poisson_process
This fixes #12620
Change-Id: If2400809ed3c41de504dd6cff06be14e476ff96c
Reviewed-on: https://go-review.googlesource.com/14590
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/fastlog2table.go')
-rw-r--r-- | src/runtime/fastlog2table.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/runtime/fastlog2table.go b/src/runtime/fastlog2table.go new file mode 100644 index 0000000000..c36d5835f6 --- /dev/null +++ b/src/runtime/fastlog2table.go @@ -0,0 +1,43 @@ +// AUTO-GENERATED by mkfastlog2table.go +// Run go generate from src/runtime to update. +// See mkfastlog2table.go for comments. + +package runtime + +const fastlogNumBits = 5 + +var fastlog2Table = [1<<fastlogNumBits + 1]float64{ + 0, + 0.0443941193584535, + 0.08746284125033943, + 0.12928301694496647, + 0.16992500144231248, + 0.2094533656289499, + 0.24792751344358555, + 0.28540221886224837, + 0.3219280948873623, + 0.3575520046180837, + 0.39231742277876036, + 0.4262647547020979, + 0.4594316186372973, + 0.4918530963296748, + 0.5235619560570128, + 0.5545888516776374, + 0.5849625007211563, + 0.6147098441152082, + 0.6438561897747247, + 0.6724253419714956, + 0.7004397181410922, + 0.7279204545631992, + 0.7548875021634686, + 0.7813597135246596, + 0.8073549220576042, + 0.8328900141647417, + 0.8579809951275721, + 0.8826430493618412, + 0.9068905956085185, + 0.9307373375628862, + 0.9541963103868752, + 0.9772799234999164, + 1, +} |