Skip to content
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

Optimise exponentiation #58

Open
GilesStrong opened this issue Jun 6, 2020 · 0 comments
Open

Optimise exponentiation #58

GilesStrong opened this issue Jun 6, 2020 · 0 comments
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

Comments

@GilesStrong
Copy link
Owner

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 compare math.pow to np.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 **.

@GilesStrong GilesStrong added 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 labels Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant