]> Cypherpunks repositories - gostls13.git/commit
bytes, strings: optimize Repeat
authorRui Ueyama <ruiu@google.com>
Thu, 12 Jun 2014 02:03:59 +0000 (19:03 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 12 Jun 2014 02:03:59 +0000 (19:03 -0700)
commit7bcbb65d7879f17b185cee9ab4ab392da0bd865f
tree32e2589bcc426a1be9cf56e0f4fa5b1738a129b1
parent22a5d2cc961a0f115ebd61f41cabec6e668ed451
bytes, strings: optimize Repeat

Call copy with as large buffer as possible to reduce the
number of function calls.

benchmark                 old ns/op    new ns/op    delta
BenchmarkBytesRepeat            540          162  -70.00%
BenchmarkStringsRepeat          563          177  -68.56%

LGTM=josharian
R=golang-codereviews, josharian, dave, dvyukov
CC=golang-codereviews
https://golang.org/cl/90550043
src/pkg/bytes/bytes.go
src/pkg/bytes/bytes_test.go
src/pkg/strings/strings.go
src/pkg/strings/strings_test.go