]> Cypherpunks repositories - gostls13.git/commit
runtime: lower memory overhead of heap profiling.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Thu, 31 May 2012 21:30:55 +0000 (23:30 +0200)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Thu, 31 May 2012 21:30:55 +0000 (23:30 +0200)
commitbaf91c313fdd50601f40915fa42a423faa1a5c76
treed85d50e67839031a16197167426144c6e6472d5f
parent29e32d73efc0cd6df128097f4f686d134411cc17
runtime: lower memory overhead of heap profiling.

The previous code was preparing arrays of entries that would be
filled if there was one entry every 128 bytes. Moving to a 4096
byte interval reduces the overhead per megabyte of address space
to 2kB from 64kB (on 64-bit systems).
The performance impact will be negative for very small MemProfileRate.

test/bench/garbage/tree2 -heapsize 800000000 (default memprofilerate)
Before: mprof 65993056 bytes (1664 bucketmem + 65991392 addrmem)
After:  mprof  1989984 bytes (1680 bucketmem +  1988304 addrmem)

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6257069
src/pkg/runtime/mprof.goc