1
0
mirror of https://github.com/golang/go synced 2024-11-06 13:36:12 -07:00
go/src/bytes
Archana R 7ca1e2aa56 internal/bytealg: optimize index function for ppc64le/power9
Optimized index2to16 loop by unrolling the loop by 4.
Multiple benchmark tests show performance improvement on
POWER9. Similar improvements are seen on POWER10. Added
tests to ensure changes work fine.

name            old time/op   new time/op    delta
Index/10         18.3ns ± 0%    19.7ns ±25%     ~
Index/32         75.3ns ± 0%    69.2ns ± 0%   -8.22%
Index/4K         5.53µs ± 0%    3.69µs ± 0%  -33.20%
Index/4M         5.64ms ± 0%    3.75ms ± 0%  -33.55%
Index/64M        92.9ms ± 0%    61.6ms ± 0%  -33.69%
IndexHard2       1.41ms ± 0%    0.93ms ± 0%  -33.75%
CountHard2       1.41ms ± 0%    0.93ms ± 0%  -33.75%

Change-Id: If9331df6a141a4716724b8cb648d2b91bdf17e5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/377016
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Archana Ravindar <aravind5@in.ibm.com>
2022-05-09 12:02:02 +00:00
..
boundary_test.go bytes: test for page boundary crosses on sep of Index 2021-11-02 17:31:50 +00:00
buffer_test.go bytes: rely on runtime.growslice for growing 2022-03-10 16:24:16 +00:00
buffer.go bytes: rely on runtime.growslice for growing 2022-03-10 16:24:16 +00:00
bytes_test.go internal/bytealg: optimize index function for ppc64le/power9 2022-05-09 12:02:02 +00:00
bytes.go bytes: explode checks for n too large 2022-04-16 02:01:19 +00:00
compare_test.go bytes: add endian base compare test 2019-10-07 14:49:57 +00:00
example_test.go bytes: add example with (*Buffer).Cap, (*Buffer).Read, (*Buffer).ReadByte 2021-11-05 21:26:54 +00:00
export_test.go bytes, internal/bytealg: simplify Equal 2019-04-24 00:56:36 +00:00
reader_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
reader.go