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
Specialize Numeric.showHex/Bin for Word types #124
Comments
Given that I don't follow your benchmarks, why are you using |
With benchmark I wanted to show that the check is retained. Formally it is redundant operation. I was using Int originally, deriving the type from I stuck a bit with the showHex constrain during debugging - it is hard to decode bits from negative numbers in decimal base in failed assertions and after some time I figured out a casting hack That's why I am biased about the check. I think inlining might not help if calling place doesn't know type and have same Integral constrain, right? |
I lost second argument of Following specialization works with negative Ints and 3.5 faster
showHex for Integer has |
@yaitskov could you please raise a specific MR you'd like to champion? |
@yaitskov if there is no progress on this proposal within two weeks, I'll close it as abandoned. |
Closing as abandoned. |
Hi,
showHex is defined for Integrals and checks the argument for negative.
For unsigned types (e.g. Word), this check is not needed, but retained and executed.
showHex for Int and Word takes same time
Specializing f makes difference
The text was updated successfully, but these errors were encountered: