1
0
mirror of https://github.com/golang/go synced 2024-10-04 02:21:21 -06:00
go/src/pkg/strconv
Rémy Oudompheng c1c027964e strconv: faster FormatFloat for fixed number of digits.
The performance improvement applies to the case where
prec >= 0 and fmt is 'e' or 'g'.

Additional minor optimisations are included. A small
performance impact happens in some cases due to code
refactoring.

benchmark                              old ns/op    new ns/op    delta
BenchmarkAppendFloat64Fixed1                 623          235  -62.28%
BenchmarkAppendFloat64Fixed2                1050          272  -74.10%
BenchmarkAppendFloat64Fixed3                3723          243  -93.47%
BenchmarkAppendFloat64Fixed4               10285          274  -97.34%

BenchmarkAppendFloatDecimal                  190          206   +8.42%
BenchmarkAppendFloat                         387          377   -2.58%
BenchmarkAppendFloatExp                      397          339  -14.61%
BenchmarkAppendFloatNegExp                   377          336  -10.88%
BenchmarkAppendFloatBig                      546          482  -11.72%

BenchmarkAppendFloat32Integer                188          204   +8.51%
BenchmarkAppendFloat32ExactFraction          329          298   -9.42%
BenchmarkAppendFloat32Point                  400          372   -7.00%
BenchmarkAppendFloat32Exp                    369          306  -17.07%
BenchmarkAppendFloat32NegExp                 372          305  -18.01%

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6462049
2012-09-01 16:31:46 +02:00
..
atob_test.go strconv: new API 2011-12-05 15:48:21 -05:00
atob.go strconv: include package and function name in error strings 2011-12-13 10:42:05 -08:00
atof_test.go strconv: speedup AppendFloat/FormatFloat. 2012-08-05 20:30:13 +02:00
atof.go strconv: extend fast parsing algorithm to ParseFloat(s, 32) 2012-06-13 23:52:00 +02:00
atoi_test.go strconv: include package and function name in error strings 2011-12-13 10:42:05 -08:00
atoi.go strconv: consistent parameter names for ParseUint 2012-08-20 22:30:04 +10:00
decimal_test.go strconv: make Ftoa faster 2011-11-15 12:17:25 -05:00
decimal.go strconv: extend Grisu3 algorithm to float32. 2012-07-10 07:44:23 +02:00
extfloat.go strconv: faster FormatFloat for fixed number of digits. 2012-09-01 16:31:46 +02:00
fp_test.go doc: fix comments referring to removed API funcs 2012-01-14 10:59:45 -08:00
ftoa_test.go strconv: faster FormatFloat for fixed number of digits. 2012-09-01 16:31:46 +02:00
ftoa.go strconv: faster FormatFloat for fixed number of digits. 2012-09-01 16:31:46 +02:00
internal_test.go strconv: make Ftoa faster 2011-11-15 12:17:25 -05:00
isprint.go strconv: remove dependence on unicode and strings 2012-03-07 13:50:31 +11:00
itoa_test.go strconv: make malloc tests more reliable 2012-04-14 21:34:08 +10:00
itoa.go strconv: better documentation for FormatInt, FormatUint. 2012-05-24 16:24:39 -07:00
makeisprint.go strconv: remove dependence on unicode and strings 2012-03-07 13:50:31 +11:00
quote_test.go strconv: remove dependence on unicode and strings 2012-03-07 13:50:31 +11:00
quote.go strconv: remove dependence on unicode and strings 2012-03-07 13:50:31 +11:00
strconv_test.go strconv: 2x-4x speed improvement for atof64. 2012-04-21 13:56:51 +02:00
testfp.txt