[netcdf-java] DODSNetcdfFile constructor slow
John Caron
caron at unidata.ucar.edu
Sat Jan 26 12:45:07 MST 2008
Hi Mike: yes, 32 Mb is a bit excessive. Is this a 1D coordinate variable? Is the dods server publically available?
Anyway, the simplest solution is probably to restrict preloading to a maximum size, and allowing the user to control that. Easiest to make it global. Do you have a use case that requires finer granularity, eg by dataset?
John
>
>
> Godin, Michael wrote:
>> I am trying to open a DODS file and read a few values from it quickly. However, one of its coordinate variables has about 4 million double values, which are always cached when a DODSNetcdfFile is created due to the default preload setting. Thus, reading a few values involves at least 32MB of network traffic, which can take quite a while.
>>
>> I have a workaround (a subclassed version of DODSNetcdfFile that allows me to toggle preload), but it would certainly seem more elegant to allow one to specify in the DODSNetcdfFile constructor whether to preload, or to set some constraints on when preloading occurs (for example, if the coordinate axis contains less than X values). Would it be possible to put this on the "feature list" for the next version of netcdf-java?
>>
>> Thanks, Mike
>>
>> _____________________________________________
>> Michael A. Godin
>> Software Engineer
>> Monterey Bay Aquarium Research Institute
>> Phone: 831-775-2063 http://www.mbari.org
>> _______________________________________________
>> netcdf-java mailing list
>> netcdf-java at unidata.ucar.edu
>> For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/
More information about the netcdf-java
mailing list