How to activate cache for variables #1399
-
I am processing a NetCDF file containing a Variable with dimensions 10800 by 21600, and chunk size 1350U, 2700U. I wish to scan it in row-major order. It works like a charm when I activate the cache:
But if I do not make this call, the process absolutely crawls (rather than taking 10 seconds, it takes nearly an hour) . Well, using setCaching() is awesome, except that the method is deprecated. As far as I can tell, there is no other way to enable the cache. I tried:
which does not make any difference. So, my question is what am I missing and what is the recommended way to proceed? Thanks. P.S. I am using cdm-core version 5.6.0. The data file in question is the ETOPO Global Relief Model available at the NCEI THREADDS Server |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Greetings @gwlucastrig! That deprecation was added a few years back when we were looking to update the API to use produce immutable objects. I'm still playing a bit of catchup since returning to Unidata to see where those efforts landed. However, even in light of immutability, being able to call |
Beta Was this translation helpful? Give feedback.
Greetings @gwlucastrig! That deprecation was added a few years back when we were looking to update the API to use produce immutable objects. I'm still playing a bit of catchup since returning to Unidata to see where those efforts landed. However, even in light of immutability, being able to call
setCaching
for the read path is important, as you have pointed out.I consider that method as being deprecated for use outside of reading (not sure what that use-case would be at the moment), and I can update the docstring to reflect that.I'm going to need to give that more thought. There will be a way to allow cached reads on a per variable basis, but I'm not quite sure what it will look like at…