• Josh Bleecher Snyder's avatar
    runtime: strength reduce key pointer calculations in mapaccess*_fast* · dad5d76e
    Josh Bleecher Snyder authored
    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: default avatarKeith Randall <khr@golang.org>
    dad5d76e
hashmap_fast.go 21.6 KB