Closed maciej closed 5 years ago
This doesn't improve performance because initial hand written implementation was crafted to trigger Go compiler optimization.
Go 1.9 is old enough now. Having an explicit rotate left is however nice - if only for readability - so I the patch is still positive.
Thanks for proposing that, I'll update rotate 32 as well along the same lines.
This PR introduces
bits.RotateLeft64
in place of 2 shifts + binary or operationsSadly does not look like it improves performance (tested on a 2017 15' MacBookPro, Go 1.10.3)
without
bits.RotateLeft64
:with
bits.RotateLeft64
:I'm leaving it up for discussion. Perhaps someone else could run the benchmarks on different hardware.