Slug #679
power for PPs is too slow
Description
Profiling showed that powering PPs incurred a significant time penalty in the (prototype) code for ImplicitDirect
.
The problem is that the default repr for exponents is "order vector", and checking for overflow is costly in this case (as myDecompress
must be called).
Proposal: separate the overflow checking from the computation of the power.
Related issues
History
#1 Updated by John Abbott almost 9 years ago
- Assignee set to John Abbott
PPMonoid
to offer 2 fns:
myPower
which just computes the power without checking for overflowmyPowerOverflowCheck
which just checks for overflow without computing the power
myPowerFast
compute power, no overflow checkmyPowerCheck
compute power, with overflow check
However, in the end I preferred the former design: it fits better with the design motto of making a fn do just 1 task, and seems easier to use in practice.
#2 Updated by John Abbott almost 9 years ago
- % Done changed from 0 to 30
I have implemented a first version. All tests pass. Still needs cleaning; must update doc. I'll pass prototype to Anna so she can verify it solves the speed problem.
Update Anna reports a slight improvement in speed (but much less than hoped).
#3 Updated by John Abbott over 8 years ago
- % Done changed from 30 to 60
Apparently I have already done almost everything (but still have to check in).
I was surprised to see that we do not do anything "clever" when multiplying or powering: I had expected the code to view the exponent vectors as an array of long
with the possibility of handling several exponents at the same time. Is this a bug or a feature?
#4 Updated by John Abbott over 8 years ago
- Status changed from New to Closed
- % Done changed from 60 to 100
Apparently everything was already checked in... So I'm considering that ad hoc in-house testing has already happened... Closing this issue!
#5 Updated by John Abbott over 8 years ago
- Estimated time set to 2.56 h