1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:44:44 -07:00
go/src/bytes
Keith Randall 936b977c17 bytes: reduce work in IndexNearPageBoundary test
This test was taking too long on ppc64x.
There were a few reasons.

The first is that the page size on ppc64x is 64k instead of 4k.
That's 16x more work.

The second is that the generic Index is pretty bad in this case.
It first calls IndexByte which does a bunch of setup work only to find
the byte we're looking for at index 0.  Then it calls Equal which
has to look at the whole string to find a difference on the last byte.

To fix, just limit our attention to near the end of the page.

Change-Id: I6b8bcbb94652a2da853862acc23803def0c49303
Reviewed-on: https://go-review.googlesource.com/76050
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-04 11:09:49 +00:00
..
boundary_test.go bytes: reduce work in IndexNearPageBoundary test 2017-11-04 11:09:49 +00:00
buffer_test.go bytes: panic in ReadFrom with more information with negative Read counts 2017-10-06 06:49:40 +00:00
buffer.go bytes: panic in ReadFrom with more information with negative Read counts 2017-10-06 06:49:40 +00:00
bytes_amd64.go bytes: explicitly state if a function expects UTF-8-encoded data 2017-10-02 00:31:47 +00:00
bytes_decl.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
bytes_generic.go bytes: explicitly state if a function expects UTF-8-encoded data 2017-10-02 00:31:47 +00:00
bytes_s390x.go bytes: explicitly state if a function expects UTF-8-encoded data 2017-10-02 00:31:47 +00:00
bytes_test.go bytes: set cap of slices returned by Split and Fields and friends 2017-11-03 19:06:15 +00:00
bytes.go bytes: set cap of slices returned by Split and Fields and friends 2017-11-03 19:06:15 +00:00
compare_test.go all: single space after period. 2016-03-02 00:13:47 +00:00
example_test.go bytes: add examples of Equal and IndexByte 2017-10-16 03:34:28 +00:00
export_test.go bytes: add optimized countByte for amd64 2017-03-21 20:25:17 +00:00
reader_test.go bytes: improve test readability 2017-09-20 13:41:03 +00:00
reader.go bytes: add documentation to reader methods 2017-09-21 18:57:04 +00:00