]> Cypherpunks repositories - gostls13.git/commit
runtime: initialize itab.hash always
authorKeith Randall <khr@golang.org>
Wed, 31 May 2017 18:57:07 +0000 (11:57 -0700)
committerKeith Randall <khr@golang.org>
Tue, 15 Aug 2017 01:52:40 +0000 (01:52 +0000)
commitfcf445dce22f96f874932b37962acba40d51e000
tree94567ea3076ecb247822da385df0edd95088638d
parent04d6f982ae63c4026bf5f65891547b3353d3b63b
runtime: initialize itab.hash always

We weren't initializing this field for dynamically-generated itabs.
Turns out it doesn't matter, as any time we use this field we also
generate a static itab for the interface type / concrete type pair.
But we should initialize it anyway, just to be safe.

Performance on the benchmarks in CL 44339:
benchmark               old ns/op     new ns/op     delta
BenchmarkItabFew-12     1040585       26466         -97.46%
BenchmarkItabAll-12     228873499     4287696       -98.13%

Change-Id: I58ed2b31e6c98b584122bdaf844fee7268b58295
Reviewed-on: https://go-review.googlesource.com/44475
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/runtime/iface.go