Multiply by power of 5 and then shift left #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is up to 10% more performant to multiply by power of 5 and then shift left than multiplying directly by power of 10 for some bit ranges when used standard
BigInteger.multiply()
.Minimal number of bits, for which is variant more performant was determined to 800 using benchmark.
The use of powers of five is limited from above by constant
FftMultiplier.FFT_THRESHOLD
.There is several times more places to be changed than provided example in 1041b4b.
There is some performance trade off in proposed example, as powers of five are computed separately of powers of ten so some powers of ten are stored uselessly since. More aggressive changes to the code are necessary then.