Optimise exponentiation #58
Labels
improvement
Something which would improve current status, but not add anything new
investigation
Something which might require a careful study
low priority
Not urgent and won't degrade with time
https://chrissardegna.com/blog/posts/python-expontentiation-performance/ studies the performance of different methods of exponentiation and finds that chained multiplication should be used for integer powers less than, or equal to, 5, and
math.pow()
should be used otherwise. I.e. never use**
.It doesn't study exponentiation of Numpy arrays. Probably it will be useful to check if
np.pow
and**
are equivalent, and to comparemath.pow
tonp.pow
. There is also and argument for readability against chained multiplication.This is only minor, but it could be useful to go through the code-base and optimise the exponentiation that is used. Probably just search for
**
.The text was updated successfully, but these errors were encountered: