gwlucastrig opened a new pull request #78:
URL: https://github.com/apache/commons-imaging/pull/78


   Checking the Coverall reports, I spotted an unused area in DataReaderStrips 
and DataReaderTiled.  This block of code was attached to the 2012 performance 
fixes. As far as I can tell, there are no TIFF configurations that would 
exercise it. And, even if there were TIFF files that would use it, the new code 
in this pull request would still work on them.   The idea behind the old 
performance fixes was that we dedicate custom  blocks of code to frequently 
used settings and let the generic code handle the rest. Because the custom code 
could be tuned to the particular TIFF configuration, it would run faster.
   
   I also noticed that the old code did not handle cases where RGB style files 
were compressed and used a predictor.  So I modified it slightly to handle the 
predictor rather than allowing the code to fall through to the generic block.  
I tested this on a image I have that is quite large 6000-by-4000 pixels and the 
performance improved substantially.  Below are the results using the 
ApacheImagingSpeedAndMemory class that is in the commons-imaging example folder.
   
   I tried to make the changes be as clear as possible to simplify inspection.  
I will check Trevor later to make sure I managed to improve coverage (or at 
least not degrade it).
   
   
    ```
   Processing file: CONUS_LandWaterMask_LZW_RGB.tif (original)
    image size: 6000 by 4000
   
    time to load image    --         memory
    time ms      avg ms   --    used mb   total mb
     971.817     0.000    --    213.592   252.000 
     921.690     0.000    --    143.229   260.000 
     895.587   895.587    --     96.234   174.000 
     899.227   897.407    --    117.259   154.000 
     899.078   897.964    --    134.200   184.000 
     889.602   895.873    --    143.226   180.000 
     896.170   895.933    --    128.183   188.000 
     894.250   895.652    --     97.187   178.000 
     896.436   895.764    --    103.226   186.000 
     891.540   895.236    --    119.185   171.000 
    
    Processing file: CONUS_LandWaterMask_LZW_RGB.tif (with chamges)
     image size: 6000 by 4000
   
    time to load image    --         memory
    time ms      avg ms   --    used mb   total mb
     498.123     0.000    --    212.589   252.000 
     423.136     0.000    --    110.733   237.000 
     396.021   396.021    --    100.735   164.000 
     400.435   398.228    --    115.725   160.000 
     400.901   399.119    --    114.726   162.000 
     395.092   398.112    --    118.711   159.000 
     394.106   397.311    --    118.710   159.000 
     400.866   397.903    --    118.710   159.000 
     400.972   398.342    --    115.710   160.000 
     397.218   398.201    --    109.691   164.000 
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to