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

perf: speed up rotation by about 20% #228

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

nicrie
Copy link
Contributor

@nicrie nicrie commented Sep 12, 2024

Move some computations in front of the loop and use broadcasting instead of matrix multiplication. I ran some tests that showed an improved performance of about 20 % on average. I also tried numba but that did not bring any significant gains.

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@7cba749). Learn more about missing BASE report.

Files with missing lines Patch % Lines
xeofs/linalg/_numpy/_rotation.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #228   +/-   ##
==========================================
  Coverage           ?   24.65%           
==========================================
  Files              ?       58           
  Lines              ?     3970           
  Branches           ?        0           
==========================================
  Hits               ?      979           
  Misses             ?     2991           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nicrie nicrie requested a review from slevang September 13, 2024 00:00
@nicrie
Copy link
Contributor Author

nicrie commented Sep 13, 2024

@slevang just in case you have some smart ideas how to make this rotation process more efficient.

Copy link
Contributor

@slevang slevang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, no ideas :) looks good to me. In my (limited) experience, rotation is pretty fast, and good enough, if you accept a lower convergence tolerance.

@nicrie nicrie merged commit bcbaa9e into develop Sep 13, 2024
8 checks passed
@nicrie nicrie deleted the rotation-performance branch September 13, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants