]> Cypherpunks repositories - gostls13.git/commit
runtime: special case interface hashing for pointers
authorKeith Randall <khr@golang.org>
Thu, 13 Feb 2020 16:34:41 +0000 (08:34 -0800)
committerKeith Randall <khr@golang.org>
Mon, 24 Feb 2020 19:41:31 +0000 (19:41 +0000)
commitafd691c579198387c874512ef1c75db651dba9bd
tree39b2fd8f5ad02b9431d3afa8edbeb28c77d36bc6
parent1c0d664128ed5f1d7c66afb69cb2d15064a1ba43
runtime: special case interface hashing for pointers

Interfaces often contain pointers. Implement a fast path for this case.

name                   old time/op  new time/op  delta
MapInterfaceString-16  21.4ns ±19%  20.5ns ±10%     ~     (p=0.361 n=10+10)
MapInterfacePtr-16     25.8ns ± 8%  17.3ns ± 7%  -33.11%  (p=0.000 n=10+9)

Fixes #37086

Change-Id: Ice52820e6259a3edeafcbbbeb25b1e363bef00d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/219338
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/alg.go