• Hiroshi Ioka's avatar
    strings: make IndexRune faster · 8737dac1
    Hiroshi Ioka authored
    re-implement IndexRune by Index which is well optimized to get
    performance gain.
    
    name                   old time/op  new time/op  delta
    IndexRune-4            30.2ns ± 1%  28.3ns ± 1%   -6.22%  (p=0.000 n=20+19)
    IndexRuneLongString-4   156ns ± 1%    49ns ± 1%  -68.72%  (p=0.000 n=19+19)
    IndexRuneFastPath-4    10.6ns ± 2%  10.0ns ± 1%   -6.30%  (p=0.000 n=18+18)
    
    Change-Id: Ie663b8f7860ca51892dd4be182fca3caa5f8ae61
    Reviewed-on: https://go-review.googlesource.com/28546Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    8737dac1
strings.go 18.9 KB