• Dmitry Vyukov's avatar
    reflect: cache call frames · 67f8a813
    Dmitry Vyukov authored
    Call frame allocations can account for significant portion
    of all allocations in a program, if call is executed
    in an inner loop (e.g. to process every line in a log).
    On the other hand, the allocation is easy to remove
    using sync.Pool since the allocation is strictly scoped.
    
    benchmark           old ns/op     new ns/op     delta
    BenchmarkCall       634           338           -46.69%
    BenchmarkCall-4     496           167           -66.33%
    
    benchmark           old allocs     new allocs     delta
    BenchmarkCall       1              0              -100.00%
    BenchmarkCall-4     1              0              -100.00%
    
    Update #7818
    
    Change-Id: Icf60cce0a9be82e6171f0c0bd80dee2393db54a7
    Reviewed-on: https://go-review.googlesource.com/1954Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    67f8a813
Name
Last commit
Last update
..
all_test.go Loading commit data...
asm_386.s Loading commit data...
asm_amd64.s Loading commit data...
asm_amd64p32.s Loading commit data...
asm_arm.s Loading commit data...
asm_ppc64x.s Loading commit data...
deepequal.go Loading commit data...
example_test.go Loading commit data...
export_test.go Loading commit data...
makefunc.go Loading commit data...
set_test.go Loading commit data...
tostring_test.go Loading commit data...
type.go Loading commit data...
value.go Loading commit data...