• 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
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...