go/src/strings
Keith Randall 4bb9b61677 strings: lower running time of TestCompareStrings
At each comparison, we're making a copy of the whole string.
Instead, use unsafe to share the string backing store with a []byte.

It reduces the test time from ~4sec to ~1sec on my machine
(darwin/amd64).  Some builders were having much more trouble with this
test (>3min), it may help more there.

Fixes #26174
Fixes #28573
Fixes #26155
Update #26473

Change-Id: Id5856fd26faf6ff46e763a088f039230556a4116
Reviewed-on: https://go-review.googlesource.com/c/147358
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-04 18:55:55 +00:00
..
builder.go strings: add Builder.Cap 2018-08-20 13:04:52 +00:00
builder_test.go strings: add Builder.Cap 2018-08-20 13:04:52 +00:00
compare.go
compare_test.go strings: lower running time of TestCompareStrings 2018-11-04 18:55:55 +00:00
example_test.go all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
export_test.go strings: select Replacer algorithm and build machine lazily 2018-08-21 02:50:58 +00:00
reader.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00
reader_test.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00
replace.go strings: Replace s[:] to s where s is a slice. 2018-10-13 11:17:13 +00:00
replace_test.go strings: speed up Map 2017-02-24 22:53:05 +00:00
search.go all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
search_test.go all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
strings.go strings: correctly handle invalid utf8 sequences in Map 2018-10-03 21:27:10 +00:00
strings.s
strings_decl.go strings: declare IndexByte as noescape 2018-10-30 20:03:54 +00:00
strings_test.go strings: correctly handle invalid utf8 sequences in Map 2018-10-03 21:27:10 +00:00