geosolutions-it / jai-ext

Java Advanced Imaging Open Source Replacement Wannabe
Apache License 2.0
90 stars 38 forks source link

MosaicOpImage excess memory allocation and needless operations #228

Closed aaime closed 5 years ago

aaime commented 5 years ago

MosaicOpImage allocates much more objects/arrays/memory than its JAI predecessor. Sources of allocations:

Moreover, the code does the expensive array accesses to get the data before checking if the current data has any validity with alpha and ROI, doing more operations than necessary. First check the "one banded" alpha/ROI, then loop over the N input bands to collect the data, but only if necessary.

Fixing the above makes JAI-EXT image mosaic perform at the same level as the JAI one, at least for the

aaime commented 5 years ago

Resolved in 1.1.x