-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Data.Bits.unsafeShift* instead of shift*? #569
Comments
Performance of shiftL/R might soon get worse than the unsafe variants. See https://gitlab.haskell.org/ghc/ghc/merge_requests/113 |
Related: #216 |
It appears that GHC optimizes
to
Nonetheless it would be clearer and safer to remove the usage of How about we add two functions |
I stumbled across this issue again, and I would like to get it finally resolved. How do you feel about my comment above, @treeowl? |
There are no more |
Now that
containers
hasbase >= 4.6
it can unconditionally useunsafeShiftR
andunsafeShiftL
fromData.Bits
which might be fastershift{R,L}
.I'm also wondering whether the many shifts by 1 should be replaced by calls to two helper functions
double
andhalf
.The text was updated successfully, but these errors were encountered: