]> Cypherpunks repositories - gostls13.git/commit
strconv: 34% to 63% faster conversions
authorRobert Griesemer <gri@golang.org>
Tue, 6 Dec 2011 16:15:45 +0000 (08:15 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 6 Dec 2011 16:15:45 +0000 (08:15 -0800)
commite0c006a9b0224ba6a346663724f9f8660321d5f3
treed675ce6a83b7ab140b6c7fcfe5027e128f9d2182
parent46deaa297bcf76438ae17b070ef351d5b91d3d59
strconv: 34% to 63% faster conversions

(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
src/pkg/strconv/itoa.go
src/pkg/strconv/itoa_test.go