]> Cypherpunks repositories - gostls13.git/commit
Trivial optimization.
authorKyle Consalus <consalus@gmail.com>
Tue, 18 May 2010 23:29:24 +0000 (16:29 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 18 May 2010 23:29:24 +0000 (16:29 -0700)
commit2db47c908318b855fc81c2c44d64d4d1fcadb1fc
tree9b0eb7e55ee486fe54c006c1a7890b5110281f00
parentbcdcf395e519e88a667c8e1e46782c2943f6b96c
Trivial optimization.
Cached string indexing in inner loop of Btoui64.

    Before:
    strconv_test.BenchmarkAtoi   5000000           309 ns/op
    strconv_test.BenchmarkAtoiNeg    5000000           325 ns/op
    strconv_test.BenchmarkAtoi64     5000000           465 ns/op
    strconv_test.BenchmarkAtoi64Neg  5000000           469 ns/op

    After:
    strconv_test.BenchmarkAtoi  10000000           182 ns/op
    strconv_test.BenchmarkAtoiNeg   10000000           193 ns/op
    strconv_test.BenchmarkAtoi64    10000000           251 ns/op
    strconv_test.BenchmarkAtoi64Neg 10000000           258 ns/op

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1227042
src/pkg/strconv/atoi.go