]> Cypherpunks repositories - gostls13.git/commit
reflect: avoid calling common if type is known to be *rtype
authorMartin Möhrmann <moehrmann@google.com>
Wed, 21 Feb 2018 21:27:12 +0000 (22:27 +0100)
committerMartin Möhrmann <moehrmann@google.com>
Thu, 22 Feb 2018 07:18:15 +0000 (07:18 +0000)
commit1dbe4c50f2e722765240c8f2fc261eab83802f99
tree7d7c5b1fbeb95c78a2a7f43de54f81252aa65779
parentf4c3072cf53889b2f11c97ee0bca53925b791f5f
reflect: avoid calling common if type is known to be *rtype

If the type of Type is known to be *rtype than the common
function is a no-op and does not need to be called.

name  old time/op  new time/op  delta
New   31.0ns ± 5%  30.2ns ± 4%  -2.74%  (p=0.008 n=20+20)

Change-Id: I5d00346dbc782e34c530166d1ee0499b24068b51
Reviewed-on: https://go-review.googlesource.com/96115
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/reflect/value.go