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

Speed up list_observation_ids() #6432

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

nikwit
Copy link
Contributor

@nikwit nikwit commented Jan 7, 2025

Proposed changes

I found that listing the observation ids can take a long time for files with a lot of observations. This is because the method sorts the ids according to the observation values which are called O(N log(N)) times during the sort - but this is an expensive operation.

In this PR, the method is changed to pre-compute the observation values so the operation is only carried out N times. This very noticeably sped up some of my post-processing scripts.

@nikwit nikwit added the small Only changes a few lines of code, does a rename or is otherwise quick to review label Jan 7, 2025
@knelli2 knelli2 merged commit 424f543 into sxs-collaboration:develop Jan 9, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Only changes a few lines of code, does a rename or is otherwise quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants