]> Cypherpunks repositories - gostls13.git/commit
runtime: strength reduce key pointer calculations in mapaccess*_fast*
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 21 Aug 2017 15:45:57 +0000 (08:45 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 23 Aug 2017 13:47:14 +0000 (13:47 +0000)
commitdad5d76e8fff6370f73748c7237b64bda0af13bd
treefc925189b51a05f120f98f5ccfff9d5b0ff06bad
parent15d5fa0291119f195d2d9b9827b650d0e98b85a3
runtime: strength reduce key pointer calculations in mapaccess*_fast*

While we're here, check string length before checking b.tophash.

name                     old time/op  new time/op  delta
MapStringKeysEight_16-8  11.4ns ±10%   7.0ns ± 2%  -38.27%  (p=0.000 n=29+28)
MapStringKeysEight_32-8  10.9ns ± 2%   6.3ns ± 3%  -41.89%  (p=0.000 n=26+30)
MapStringKeysEight_64-8  10.8ns ± 3%   6.3ns ± 2%  -41.52%  (p=0.000 n=28+27)
MapStringKeysEight_1M-8  10.9ns ± 4%   6.3ns ± 2%  -41.91%  (p=0.000 n=29+29)
IntMap-8                 7.05ns ± 4%  6.77ns ± 3%   -3.94%  (p=0.000 n=29+30)

Change-Id: I0f3dc3301bdf550e4ac5250e1e64e7f2a0ffb269
Reviewed-on: https://go-review.googlesource.com/57590
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/hashmap.go
src/runtime/hashmap_fast.go
src/runtime/runtime_test.go