• Robert Griesemer's avatar
    strconv: 34% to 63% faster conversions · e0c006a9
    Robert Griesemer authored
    (Note that the Int and Uint benchmarks use different test sets
    and thus cannot be compared against each other. Int and Uint
    conversions are approximately the same speed).
    
    Before (best of 3 runs):
    strconv_test.BenchmarkFormatInt    100000    15636 ns/op
    strconv_test.BenchmarkAppendInt    100000    18930 ns/op
    strconv_test.BenchmarkFormatUint   500000     4392 ns/op
    strconv_test.BenchmarkAppendUint   500000     5152 ns/op
    
    After (best of 3 runs):
    
    strconv_test.BenchmarkFormatInt    200000    10070 ns/op (-36%)
    strconv_test.BenchmarkAppendInt    200000     7097 ns/op (-63%)
    strconv_test.BenchmarkFormatUint  1000000     2893 ns/op (-34%)
    strconv_test.BenchmarkAppendUint   500000     2462 ns/op (-52%)
    
    R=r, rsc, r
    CC=golang-dev
    https://golang.org/cl/5449093
    e0c006a9
itoa_test.go 3.83 KB