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

Investigate performance on long timeseries #20

Closed
BSchilperoort opened this issue Oct 9, 2023 · 2 comments
Closed

Investigate performance on long timeseries #20

BSchilperoort opened this issue Oct 9, 2023 · 2 comments

Comments

@BSchilperoort
Copy link
Contributor

Your work in reimplementing regridding methods is interesting! I often find ESMF to be a bit heavy on dependencies side indeed. But one crucial feature that makes it better than xr.interp is that it computes weights first and then applies them in parallel for all spatial slices. This is a major dealbreaker when dealing with long timeseries! Do you have plans on implementing something like that in pure-xarray ?

Originally posted by @aulemahal in pangeo-data/xESMF#282 (comment)

@BSchilperoort
Copy link
Contributor Author

It should be easy to compute weights and apply them, the same way that the conservative method currently does. This way we could possibly improve performance for long timeseries.

@slevang
Copy link
Collaborator

slevang commented Sep 26, 2024

I don't think this is actually an issue due to the way interpolation is applied independently across the dimensions. In some quick benchmarks on a longer timeseries, regrid.linear is anywhere from 1.2x to 4x faster than regrid.conservative depending on the chunk scheme. So I doubt we would get any improvement by instead generating our own weights and doing .dot().

Plus its pretty cool that xarray_regrid/methods/interp.py is only 52 lines, most of which are type overloads 😄

@slevang slevang closed this as completed Sep 26, 2024
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

No branches or pull requests

2 participants