]> Cypherpunks repositories - gostls13.git/commit
strconv: faster float conversion
authorRobert Griesemer <gri@golang.org>
Wed, 7 Dec 2011 18:30:27 +0000 (10:30 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 7 Dec 2011 18:30:27 +0000 (10:30 -0800)
commit127b5a66b1e350ab6a3626a81cd4a7cc7fcaf100
tree701fd9502f39333691b596dd3e800e7f31bcd13f
parentb955bbfbdbe070d65910f76dcd09276d16978e52
strconv: faster float conversion

- added AppendFloatX benchmarks
- 2% to 13% better performance
- check for illegal bitSize

benchmark                                   old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatFloatDecimal         2993         2733   -8.69%
strconv_test.BenchmarkFormatFloat                3384         3141   -7.18%
strconv_test.BenchmarkFormatFloatExp             9192         9010   -1.98%
strconv_test.BenchmarkFormatFloatBig             3279         3207   -2.20%
strconv_test.BenchmarkAppendFloatDecimal         2837         2478  -12.65%
strconv_test.BenchmarkAppendFloat                3196         2928   -8.39%
strconv_test.BenchmarkAppendFloatExp             9028         8773   -2.82%
strconv_test.BenchmarkAppendFloatBig             3151         2782  -11.71%

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5448122
src/pkg/strconv/ftoa.go
src/pkg/strconv/ftoa_test.go
src/pkg/strconv/itoa.go