Re: geogrid performance with ArrayFloat conversions

try using get1DJavaArray() instead of copyTo1DJavaArray(). This will avoid the 
copy if its already a float and in order, which should be the common case for 
grib.

Jeff McWhirter wrote:

I have traced some code reading in a big 3D grid. The first column below shows elapsed time since last call, second column shows memory delta snce last call. The >...< are nested code blocks, showing the elapsed time. This chunk of code takes 5.2 seconds. Note, 1.5 seconds is just in the toFloatArray code, converting the
ArrayFloat.D3 to a 1D float array.
Can we optimize this so the initial Array is of a form that eliminates this conversion? Perhaps we could pass in preference that tells the geogrid that the client will be asking
for 1D float data?

-Jeff


105  68      >GeoGridAdapter.getFlatField:Relative_humidity:time=2
1    2         >GeoGridAdapter.getSpatialDomainSet
0    2           GeoGridAdapter isTimeDependent = false
1    1         <GeoGridAdapter.getSpatialDomainSet ms: 1
1    1         >GeoGridAdapter.geogrid.readVolumeData
3710 18834     <GeoGridAdapter.geogrid.readVolumeData ms: 3710
0    2         >toFloatArray array:ucar.ma2.ArrayFloat$D3
0    1           >Array.copyTo1DJavaArray copy
1    1             >Array.copyTo1DJavaArray factory
1066 376           <Array.copyTo1DJavaArray factory ms: 1066
1    1             >MAMAth.copy
3    1               >MAMath.iterate
441  2               <MAMath.iterate ms: 440 cnt=6569800
1    1             <MAMAth.copy ms: 445
0    1           <Array.copyTo1DJavaArray copy ms: 1512
0    2           >Array.copyTo1DJavaArray getStorage
0    1           <Array.copyTo1DJavaArray getStorage ms: 0
1    2         <toFloatArray ms: 1514 length:6569800
0    11      <GeoGridAdapter.getFlatField:Relative_humidity:time=2 ms: 5226

===============================================================================
To unsubscribe thredds-dev, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
===============================================================================


  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: