• Ilya Tocar's avatar
    encoding/base32: improve performance in common case · 8b2f8439
    Ilya Tocar authored
    Unroll loop to improve perfromance back to 1.8 level.
    name              old time/op    new time/op    delta
    EncodeToString-6    63.0µs ± 3%    51.7µs ± 2%  -17.94%  (p=0.000 n=10+10)
    
    name              old speed      new speed      delta
    EncodeToString-6   130MB/s ± 3%   159MB/s ± 2%  +21.83%  (p=0.000 n=10+10)
    
    Vs 1.8:
    EncodeToString-6    54.9µs ± 2%    51.7µs ± 2%   -5.95%  (p=0.000 n=10+10)
    
    name              old speed      new speed      delta
    EncodeToString-6   149MB/s ± 2%   159MB/s ± 2%   +6.32%  (p=0.000 n=10+10)
    
    Fixes #21262
    
    Change-Id: I41bf7e1f61041781386d16d573bffe1a7173c0c3
    Reviewed-on: https://go-review.googlesource.com/52510
    Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    8b2f8439
base32.go 11.9 KB