• Dmitriy Vyukov's avatar
    runtime: don't acquirem on malloc fast path · 30940cfa
    Dmitriy Vyukov authored
    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
    30940cfa
Name
Last commit
Last update
..
5a Loading commit data...
5c Loading commit data...
5g Loading commit data...
5l Loading commit data...
6a Loading commit data...
6c Loading commit data...
6g Loading commit data...
6l Loading commit data...
8a Loading commit data...
8c Loading commit data...
8g Loading commit data...
8l Loading commit data...
addr2line Loading commit data...
api Loading commit data...
cc Loading commit data...
cgo Loading commit data...
dist Loading commit data...
fix Loading commit data...
gc Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal/objfile Loading commit data...
ld Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
yacc Loading commit data...