]> Cypherpunks repositories - gostls13.git/commit
math/bits: faster Rotate functions, added respective benchmarks
authorRobert Griesemer <gri@golang.org>
Fri, 17 Feb 2017 23:02:49 +0000 (15:02 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 17 Feb 2017 23:40:45 +0000 (23:40 +0000)
commit19028bdd18483689a3743639fa89d272cbb96c7b
tree57878271b3cef4b4e0f24206ab3575f1c429dd39
parenta12edb8db6f3fa93a1ccd96a0f84b647d08429ef
math/bits: faster Rotate functions, added respective benchmarks

Measured on 2.3 GHz Intel Core i7, running maxOS 10.12.3.

benchmark                    old ns/op     new ns/op     delta
BenchmarkRotateLeft-8        7.87          7.00          -11.05%
BenchmarkRotateLeft8-8       8.41          4.52          -46.25%
BenchmarkRotateLeft16-8      8.07          4.55          -43.62%
BenchmarkRotateLeft32-8      8.36          4.73          -43.42%
BenchmarkRotateLeft64-8      7.93          4.78          -39.72%

BenchmarkRotateRight-8       8.23          6.72          -18.35%
BenchmarkRotateRight8-8      8.76          4.39          -49.89%
BenchmarkRotateRight16-8     9.07          4.44          -51.05%
BenchmarkRotateRight32-8     8.85          4.46          -49.60%
BenchmarkRotateRight64-8     8.11          4.43          -45.38%

Change-Id: I79ea1e9e6fc65f95794a91f860a911efed3aa8a1
Reviewed-on: https://go-review.googlesource.com/37219
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/math/bits/bits.go
src/math/bits/bits_impl.go
src/math/bits/bits_test.go