]> Cypherpunks repositories - gostls13.git/commit
cmd/compile, etc: bring back ptrToThis
authorDavid Crawshaw <crawshaw@golang.org>
Thu, 23 Jun 2016 14:59:38 +0000 (10:59 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Thu, 23 Jun 2016 17:39:38 +0000 (17:39 +0000)
commite369490fb7db5f2d42bb0e8ee19b48378dee0ebf
tree6f1ade73531b3ab95a4acbf7b84c478fcea17bae
parentaa6345d3c91167f1e81bff9e8655e7aaac7762bd
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>
src/cmd/compile/internal/gc/reflect.go
src/reflect/all_test.go
src/reflect/type.go
src/runtime/type.go