]> Cypherpunks repositories - gostls13.git/commit
internal/bytealg: implement bytes.Count in asm for ppc64x
authorLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 27 Aug 2018 20:34:53 +0000 (16:34 -0400)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Wed, 12 Sep 2018 15:47:43 +0000 (15:47 +0000)
commita0fad982b17b8c49c8567867160dee9f021cf1ba
tree31655569c5420d062e177e94c9929aec04949cf2
parente7f5f3eca42a98340e4eb4fc5d490a9aa4bd5054
internal/bytealg: implement bytes.Count in asm for ppc64x

This adds an asm implementation for the Count function in ppc64x.
The Go code that manipulates a byte at a time is especially
inefficient on ppc64x, so an asm implementation is a significant
improvement.

bytes:
name               old time/op   new time/op    delta
CountSingle/10-8    23.1ns ± 0%    18.6ns ± 0%    -19.48%  (p=1.000 n=1+1)
CountSingle/32-8    60.4ns ± 0%    19.0ns ± 0%    -68.54%  (p=1.000 n=1+1)
CountSingle/4K-8    7.29µs ± 0%    0.45µs ± 0%    -93.80%  (p=1.000 n=1+1)
CountSingle/4M-8    7.49ms ± 0%    0.45ms ± 0%    -93.97%  (p=1.000 n=1+1)
CountSingle/64M-8    127ms ± 0%       9ms ± 0%    -92.53%  (p=1.000 n=1+1)

html:
name              old time/op  new time/op  delta
Escape-8          57.5µs ± 0%  36.1µs ± 0%  -37.13%  (p=1.000 n=1+1)
EscapeNone-8      20.0µs ± 0%   2.0µs ± 0%  -90.14%  (p=1.000 n=1+1)

Change-Id: Iadbf422c0e9a37b47d2d95fb8c778420f3aabb58
Reviewed-on: https://go-review.googlesource.com/131695
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <mike.munday@ibm.com>
src/internal/bytealg/count_generic.go
src/internal/bytealg/count_native.go
src/internal/bytealg/count_ppc64x.s [new file with mode: 0644]