diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2014-08-18 16:33:39 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2014-08-18 16:33:39 +0400 |
| commit | 30940cfad6c45d40bec377aeacc10f6964e75b76 (patch) | |
| tree | 4c77829d193bc35b4fb99d293670a81624253375 /src/pkg/runtime/runtime.h | |
| parent | c6fe53a230e70bbb7a5582afe96cacf174eb0335 (diff) | |
| download | go-30940cfad6c45d40bec377aeacc10f6964e75b76.tar.xz | |
runtime: don't acquirem on malloc fast path
Mallocgc must be atomic wrt GC, but for performance reasons
don't acquirem/releasem on fast path. The code does not have
split stack checks, so it can't be preempted by GC.
Functions like roundup/add are inlined. And onM/racemalloc are nosplit.
Also add debug code that checks these assumptions.
benchmark old ns/op new ns/op delta
BenchmarkMalloc8 20.5 17.2 -16.10%
BenchmarkMalloc16 29.5 27.0 -8.47%
BenchmarkMallocTypeInfo8 31.5 27.6 -12.38%
BenchmarkMallocTypeInfo16 34.7 30.9 -10.95%
LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, rlh, rsc
https://golang.org/cl/123100043
Diffstat (limited to 'src/pkg/runtime/runtime.h')
0 files changed, 0 insertions, 0 deletions
