• Rémy Oudompheng's avatar
    strconv: speedup AppendFloat/FormatFloat. · ff03482f
    Rémy Oudompheng authored
    The improvement is obtained by eliminating the zero
    initialization of a large structure that is only
    needed when the fast path fails.
    
    Also add a missing roundtrip test for float32s.
    
    benchmark                              old ns/op    new ns/op    delta
    BenchmarkAppendFloatDecimal                  301          180  -40.20%
    BenchmarkAppendFloat                         486          388  -20.16%
    BenchmarkAppendFloatExp                      492          383  -22.15%
    BenchmarkAppendFloatNegExp                   478          370  -22.59%
    BenchmarkAppendFloatBig                      650          541  -16.77%
    BenchmarkAppendFloat32Integer                308          180  -41.56%
    BenchmarkAppendFloat32ExactFraction          449          333  -25.84%
    BenchmarkAppendFloat32Point                  494          390  -21.05%
    BenchmarkAppendFloat32Exp                    488          387  -20.70%
    BenchmarkAppendFloat32NegExp                 488          378  -22.54%
    
    R=r, rsc
    CC=golang-dev, remy
    https://golang.org/cl/6346081
    ff03482f
Name
Last commit
Last update
..
atob.go Loading commit data...
atob_test.go Loading commit data...
atof.go Loading commit data...
atof_test.go Loading commit data...
atoi.go Loading commit data...
atoi_test.go Loading commit data...
decimal.go Loading commit data...
decimal_test.go Loading commit data...
extfloat.go Loading commit data...
fp_test.go Loading commit data...
ftoa.go Loading commit data...
ftoa_test.go Loading commit data...
internal_test.go Loading commit data...
isprint.go Loading commit data...
itoa.go Loading commit data...
itoa_test.go Loading commit data...
makeisprint.go Loading commit data...
quote.go Loading commit data...
quote_test.go Loading commit data...
strconv_test.go Loading commit data...
testfp.txt Loading commit data...