Make nmod_geometric_progression faster with Shoup precomputation if possible#2516
Make nmod_geometric_progression faster with Shoup precomputation if possible#2516maelhos wants to merge 12 commits intoflintlib:mainfrom
nmod_geometric_progression faster with Shoup precomputation if possible#2516Conversation
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
|
Unfortunately, in my measurements this does not bring much. We could have hoped for some interesting speed-up in small lengths (the part that benefits from Shoup's precomputations only involves a linear number of nmod multiplications, so we expect it to be negligible in front of the polynomial multiplication as soon as the length is not too small). But even for small lengths it is not very interesting: Maybe it's not so nice to double the amount of storage for the precomputations for a marginal gain like this. Also, for lengths below about |
|
One place where Shoup's precomputation could help is in the precomputation stage itself. Similarly to what is done for |
|
After some more investigation, the above conclusion remains: the gain is marginal and restricted to small lengths, while the code becomes a bit more complex and the precomputation takes more memory. So let's close this draft PR (this has been discussed with @maelhos via another channel). |
This draft aims at improving the recent
nmod_geometric_progressionby using Shoup's precomputed form (as mentioned by @fredrik-johansson in #2449 .For now, the precomputations are done on each vectors of constants when possible (when high bit of modulus is not set).