go/src/math/bits
Michael Munday 42a82ce1a7 math/bits: optimize Reverse32 and Reverse64
Use ReverseBytes32 and ReverseBytes64 to speed up these functions.
The byte reversal functions are intrinsics on most platforms and
generally compile to a single instruction.

name       old time/op  new time/op  delta
Reverse32  2.41ns ± 1%  1.94ns ± 3%  -19.60%  (p=0.000 n=20+19)
Reverse64  3.85ns ± 1%  2.56ns ± 1%  -33.32%  (p=0.000 n=17+19)

Change-Id: I160bf59a0c7bd5db94114803ec5a59fae448f096
Reviewed-on: https://go-review.googlesource.com/c/159358
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2019-02-26 17:52:08 +00:00
..
bits.go math/bits: optimize Reverse32 and Reverse64 2019-02-26 17:52:08 +00:00
bits_tables.go math/bits: faster LeadingZeros and Len functions 2017-02-28 20:55:13 +00:00
bits_test.go math/bits: panic when y<=hi in Div 2018-11-27 05:04:14 +00:00
example_test.go math/bits: add examples for right rotation 2017-11-03 20:12:07 +00:00
export_test.go math/bits: move tests into their own package 2018-05-01 15:33:01 +00:00
make_examples.go math/bits: add examples for right rotation 2017-11-03 20:12:07 +00:00
make_tables.go math/bits: faster LeadingZeros and Len functions 2017-02-28 20:55:13 +00:00