diff options
| author | David Crawshaw <crawshaw@golang.org> | 2016-06-23 10:59:38 -0400 |
|---|---|---|
| committer | David Crawshaw <crawshaw@golang.org> | 2016-06-23 17:39:38 +0000 |
| commit | e369490fb7db5f2d42bb0e8ee19b48378dee0ebf (patch) | |
| tree | 6f1ade73531b3ab95a4acbf7b84c478fcea17bae /src/runtime/type.go | |
| parent | aa6345d3c91167f1e81bff9e8655e7aaac7762bd (diff) | |
| download | go-e369490fb7db5f2d42bb0e8ee19b48378dee0ebf.tar.xz | |
cmd/compile, etc: bring back ptrToThis
This was removed in CL 19695 but it slows down reflect.New, which ends
up on the hot path of things like JSON decoding.
There is no immediate cost in binary size, but it will make it harder to
further shrink run time type information in Go 1.8.
Before
BenchmarkNew-40 30000000 36.3 ns/op
After
BenchmarkNew-40 50000000 29.5 ns/op
Fixes #16161
Updates #16117
Change-Id: If7cb7f3e745d44678f3f5cf3a5338c59847529d2
Reviewed-on: https://go-review.googlesource.com/24400
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/type.go')
| -rw-r--r-- | src/runtime/type.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/type.go b/src/runtime/type.go index 786f2b96f6..5ae5c73a22 100644 --- a/src/runtime/type.go +++ b/src/runtime/type.go @@ -36,9 +36,9 @@ type _type struct { // gcdata stores the GC type data for the garbage collector. // If the KindGCProg bit is set in kind, gcdata is a GC program. // Otherwise it is a ptrmask bitmap. See mbitmap.go for details. - gcdata *byte - str nameOff - _ int32 + gcdata *byte + str nameOff + ptrToThis typeOff } func (t *_type) string() string { |
