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

Improve cf.Field.__getitem__ performance by not re-calculating axis cyclicity #744

Closed
davidhassell opened this issue Mar 22, 2024 · 0 comments · Fixed by #745
Closed

Improve cf.Field.__getitem__ performance by not re-calculating axis cyclicity #744

davidhassell opened this issue Mar 22, 2024 · 0 comments · Fixed by #745
Labels
performance Relating to speed and memory performance
Milestone

Comments

@davidhassell
Copy link
Collaborator

Currently (v3.16.1), the cyclicty of all axes with dimension coordinates is checked during a Field subspace. This likely entails getting the first and last values if the coordinates, which might be very slow if the values are on (a remote) disk, or need computing.

However, the cyclicity is already known on the subspaced field's Data object (cf.Data._getitem__ updates it), so we can just take it from there and disable the expensive automatic cyclicity check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Relating to speed and memory performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant