Commit 4bb9b616 authored by Keith Randall's avatar Keith Randall Committed by Keith Randall
Browse files

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 6fe8ee78
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment