1
0
mirror of https://github.com/golang/go synced 2024-10-03 14:31:22 -06:00
go/src/reflect
Dmitry Vyukov 67f8a81316 reflect: cache call frames
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/1954
Reviewed-by: Keith Randall <khr@golang.org>
2015-01-28 08:40:26 +00:00
..
all_test.go reflect: cache call frames 2015-01-28 08:40:26 +00:00
asm_386.s
asm_amd64.s
asm_amd64p32.s
asm_arm.s
asm_ppc64x.s all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
deepequal.go
example_test.go
export_test.go reflect: cache call frames 2015-01-28 08:40:26 +00:00
makefunc.go reflect: cache call frames 2015-01-28 08:40:26 +00:00
set_test.go
tostring_test.go
type.go reflect: cache call frames 2015-01-28 08:40:26 +00:00
value.go reflect: cache call frames 2015-01-28 08:40:26 +00:00