Skip to content
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

Investigate decimal128_fast multiplication slowdown #726

Closed
mborland opened this issue Sep 19, 2024 · 2 comments
Closed

Investigate decimal128_fast multiplication slowdown #726

mborland opened this issue Sep 19, 2024 · 2 comments
Labels
Bug Something isn't working

Comments

@mborland
Copy link
Member

Takes about twice as long for decimal128_fast multiplication vs that of decimal128. Maybe because we are only using emulated types in the former?

@mborland mborland added the Bug Something isn't working label Sep 19, 2024
@mborland
Copy link
Member Author

Can the significand of the type be unsigned __int128 when available and only our emulated u128 when necessary? This should provide an immediate speedup.

@mborland
Copy link
Member Author

mborland commented Oct 2, 2024

In decimal128 we can check if the result of the two significands will be less than or equal to 128 bits and then use simplified multiplication if that's the case. For decimal128_fast the significands are always normalized so we are forced to use 256-bit multiplication which will always be slower. Removing all the trailing zeros of both significands to perform a similar comparison is quite expensive.

@mborland mborland closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant