]> Cypherpunks repositories - gostls13.git/commit
strconv: simplify and optimize Itoa(small)
authorMarvin Stenger <marvin.stenger94@gmail.com>
Thu, 3 May 2018 10:28:43 +0000 (12:28 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 3 May 2018 18:07:02 +0000 (18:07 +0000)
commit3c0bf181b79406a71b7b2fd22b4d222722b96649
tree177925e749b47a01b8915d66ae184be564111d8c
parent63756e0c8f76856a436274fc47d912815f9f17e6
strconv: simplify and optimize Itoa(small)

Use substring of digits for values < 10.

name                 old time/op  new time/op  delta
FormatIntSmall/7-4   4.54ns ± 1%  3.70ns ± 1%  -18.41%  (p=0.000 n=18+17)
FormatIntSmall/42-4  4.54ns ± 1%  4.13ns ± 1%   -9.02%  (p=0.000 n=16+18)

Change-Id: I0b521b563c13ef88aa2701049fa4a43760e884af
Reviewed-on: https://go-review.googlesource.com/111285
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/strconv/itoa.go
src/strconv/itoa_test.go