You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed what I think might be a performance bug: should .compute() be called on the input data in all the plotting methods (e.g. plot.pcolormesh()) like it is in .plot() here
I was making plots from a large dataset of a quantity that is the output of quite a bit of computation. A script which made an animation of the full time-series (a couple of thousand time points) actually ran significantly faster than a script that made pcolormesh plots of just 3 time points (~2hrs compared to ~5hrs). The difference I can think of is that the animation script called .values before the animation function, but the plotting script called xarray.plot.pcolormesh() without calling .values/.load()/.compute() first. A modified version of the script that calls .load() before any plot calls reduced the run time to 30 mins even though I plotted 18 time points, not just 3.
2d plots might all be covered by adding a darray = darray.compute() call in newplotfunc()?
We should be calling .compute() before passing anything to matplotlib - if we're not then that's a bug. I've also noticed that not doing so can cause huge slowdown.
I think that #5561 might (or really should) fix this as a side effect though.
We should create a DataArray with just the data that is needed based on x, y etc. and then call compute on the whole thing, rather than computing x separately and y separately.
I noticed what I think might be a performance bug: should
.compute()
be called on the input data in all the plotting methods (e.g.plot.pcolormesh()
) like it is in.plot()
herexarray/xarray/plot/plot.py
Line 166 in bf27e2c
I was making plots from a large dataset of a quantity that is the output of quite a bit of computation. A script which made an animation of the full time-series (a couple of thousand time points) actually ran significantly faster than a script that made pcolormesh plots of just 3 time points (~2hrs compared to ~5hrs). The difference I can think of is that the animation script called
.values
before the animation function, but the plotting script calledxarray.plot.pcolormesh()
without calling.values
/.load()
/.compute()
first. A modified version of the script that calls.load()
before any plot calls reduced the run time to 30 mins even though I plotted 18 time points, not just 3.2d plots might all be covered by adding a
darray = darray.compute()
call innewplotfunc()
?xarray/xarray/plot/plot.py
Line 609 in bf27e2c
I guess the 1d plot functions would all need to be modified individually.
The text was updated successfully, but these errors were encountered: