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

Optimise comparison of ScaledDecimals #1120

Merged
merged 1 commit into from
Jun 18, 2021
Merged

Optimise comparison of ScaledDecimals #1120

merged 1 commit into from
Jun 18, 2021

Conversation

rko281
Copy link
Contributor

@rko281 rko281 commented Jun 18, 2021

As per #1119, adds equalToScaledDecimal: double-dispatch handler in various ArithmeticValue subclasses.

To optimise SmallInteger=ScaledDecimal comparisons I initially added an implementation of = to Integer (implemented as per the primitive fallback code in LargeInteger>>#=) however this had a negative effect on SmallInteger=Float comparisons. Instead the performance of SmallInteger=ScaledDecimal comparisons has been improved by optimising Integer-ScaledDecimal subtractions - see ScaledDecimal>>#subtractFromInteger:. ScaledDecimal creation has also been optimised slightly by use of primitive 157.

Resolves #1119.

@blairmcg blairmcg merged commit 486833e into dolphinsmalltalk:release/7.1 Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve ScaledDecimal comparison performance
2 participants