-
Notifications
You must be signed in to change notification settings - Fork 15
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
Optimizing the non-normalized multiplications / divisions #72
Optimizing the non-normalized multiplications / divisions #72
Conversation
- Multiply: removed the GCD reductions - Divide: only reducing the denominators
Having done all sorts of benchmarks, with different types of reduction here is my summary:
From On an individual operation basis, Finally, compared to the |
Let's start with the As you can see- the individual As for the Here are the same results on |
And finally - the I've slightly modified the benchmark parameters from last time - this time I didn't bother with the I've also introduced a new benchmark which picks up the next operation at random (+, -, *, /)- this is the benchmark that demonstrates the importance of having some reduction to counteract the unconstrained expansion of the Here's the overview: And here are the allocations (as before, the additions all cap at 32B): The picture with Just a few observations in conclusion:
|
Ok, let me bring in one more contender to the race- in the following graphs ( Caveats:
Still, all-in-all, I'd say we're comfortably within the same performance magnitude as the |
In fact, I don't see the need for this method. I also cannot understand the reasoning behind interpreting trailing zeros as an indicator of the precision of the calculation (especially because it does not remain stable during calculations [1]). For display in the graphical interface (or other output that is read by humans), I would always prefer appropriate formatting in |
- updated the Readme.md (replaced the incorrect usage of the term "improper" when referring to the non-reduced fractions)
Ok, I've removed it. As I was updating the Readme.md section (wasn't sure if the examples were still valid) - I stumbled upon this Wikipedia section: Proper_and_improper_fractions, and from what I'm reading it appears that the term
They are several synonyms for the Irreducible fraction but I couldn't find anything about denoting the |
I remember that I was already looking for a suitable term back then. In my local language we (surprisingly) don't have a term for it either. |
Thank you for all your work. I don't think there is anyone other than you who has worked so intensively on the project. My colleagues and I have not examined performance behavior nearly as closely as you have now. |
As per my last comment from #49 here is are the proposed optimizations
Multiply
/Divide
tests using theStrictTestComparer
ConsecutiveMathOperationBenchmarks
with an additional method for testing a mix of operations (+, -, *, /)ToDecimalWithTrailingZeros
and associated usagesReadme.md