]> Cypherpunks repositories - gostls13.git/commit
internal/bytealg: optimize index function for ppc64le/power9
authorArchana R <aravind5@in.ibm.com>
Mon, 10 Jan 2022 08:15:25 +0000 (02:15 -0600)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 9 May 2022 12:02:02 +0000 (12:02 +0000)
commit7ca1e2aa56f23b1766e8f5f65c431d18abd58985
treea436c44b2667fd54620e5ea1be442bf9c2114917
parentc386269ed8746304b219d5be7d673539ae1e2643
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>
src/bytes/bytes_test.go
src/internal/bytealg/index_ppc64x.s