• Dmitriy Vyukov's avatar
    runtime: speedup malloc stats collection · 5d637b83
    Dmitriy Vyukov authored
    Count only number of frees, everything else is derivable
    and does not need to be counted on every malloc.
    benchmark                    old ns/op    new ns/op    delta
    BenchmarkMalloc8                    68           66   -3.07%
    BenchmarkMalloc16                   75           70   -6.48%
    BenchmarkMallocTypeInfo8           102           97   -4.80%
    BenchmarkMallocTypeInfo16          108          105   -2.78%
    
    R=golang-dev, dave, rsc
    CC=golang-dev
    https://golang.org/cl/9776043
    5d637b83
mcache.c 1.77 KB