Optimization of Multi to Mono Channel Extract ROI (from 8M cycles to 3M cycles)
Mantis Issue 1043, reported by lhermitte, assigned to rkanavath, created: 2015-05-04
Useless reallocation were done in OTB 3.16.
Here is a patch that makes the use of Multi to Mono Channel Extract ROI goes down from 8M cycles 3M cycles (measured by callgrind on a program compiled with -O2 -g -DNDEBUG)
The idea behind the patch is to avoid copying complex pixels at each iteration. Indeed copying the input pixel implies allocation memory to store the value of the pixel, and to release it. As we don't need to duplicate this information, we can instead store a const-reference on the input pixel.
1431519187 - rashadkmI will apply this patch after running some test on OTB trunk (4.5.0)
1431525208 - rashadkmpatch applied on OTB 4.5 and all test with ExtractROI are passing. I will commit it to trunk
1431527285 - rashadkmpatch pushed for OTB 4.5 - waiting for a next dashboard submission.
1431527536 - rashadkmhttp://hg.orfeo-toolbox.org/OTB/rev/803a713b5382