]> Cypherpunks repositories - gostls13.git/commit
strings: use sync.Pool to cache buffer
authorRui Ueyama <ruiu@google.com>
Sun, 22 Jun 2014 05:08:43 +0000 (22:08 -0700)
committerRui Ueyama <ruiu@google.com>
Sun, 22 Jun 2014 05:08:43 +0000 (22:08 -0700)
commit3142861ff86a8b4064256f31a0f63dcd23c2f971
treed26bc42254eeb316a7dd6b5c487595950e6e78bb
parent9bfb66e962b631c2faf831ccc29ba5d4018ccf04
strings: use sync.Pool to cache buffer

benchmark                         old ns/op    new ns/op    delta
BenchmarkByteReplacerWriteString       3596         3094  -13.96%

benchmark                        old allocs   new allocs    delta
BenchmarkByteReplacerWriteString          1            0  -100.00%

LGTM=dvyukov
R=bradfitz, dave, dvyukov
CC=golang-codereviews
https://golang.org/cl/101330053
src/pkg/strings/replace.go
src/pkg/strings/replace_test.go