You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2023/07/04 13:01:00 UTC

[jira] [Comment Edited] (IMAGING-356) TIFF reading extremely slow in version 1.0-SNAPSHOT

    [ https://issues.apache.org/jira/browse/IMAGING-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17739916#comment-17739916 ] 

Gary D. Gregory edited comment on IMAGING-356 at 7/4/23 1:00 PM:
-----------------------------------------------------------------

Hi [~gwlucas]

After looking at VisualVM (see screengrab), I think the difference you see between alpha3 and now could be attributable to the hardening introduced to fix out-of-memory DOS attacks found by our integration with the Google OSS-Fuzz project.

In this case, maybe the parameter checking in ImageBuilder.setRgb() which is called 49m times \(!). I did not try to undo those changes and re-profile though, as I don't think we should undo this fix. It is also worth noting that the profiling shows that 50.1% of the time is spent in the body of DataReaderStrips.interpretStrip(). There might be some optimization to do at that level or the overall algorithm.

 

!image-2023-07-04-08-52-36-535.png!


was (Author: garydgregory):
Hi [~gwlucas]

After looking at VisualVM (see screengrab), I think the difference you see between alpha3 and now could be attributable to the hardening introduced to fix out-of-memory DOS attacks found by our integration with the Google OSS-Fuzz project.

In this case, maybe the parameter checking in ImageBuilder.setRgb() which is called 49m times (!). I did not try to undo those changes and re-profile though, as I don't think we should undo this fix. It is also worth noting that the profiling shows that 50.1% of the time is spent in the body of DataReaderStrips.interpretStrip(). There might be some optimization to do at that level or the overall algorithm.

 

!image-2023-07-04-08-52-36-535.png!

> TIFF reading extremely slow in version 1.0-SNAPSHOT
> ---------------------------------------------------
>
>                 Key: IMAGING-356
>                 URL: https://issues.apache.org/jira/browse/IMAGING-356
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: TIFF
>    Affects Versions: 1.0
>            Reporter: Gary Lucas
>            Priority: Major
>         Attachments: image-2023-07-04-08-52-36-535.png
>
>
> I am using the latest code from github (1.0-SNAPSHOT downloaded from github of June 2023) to read a 300 megabyte TIFF file.  Version 1.0-alpha3 required 673 milliseconds to read that file.  The new code requires upward of 15 minutes.   Clearly something got broken since the last release.
> The TIFF file is a 10000x10000 pixel 4 byte image format organized in strips.  The bottleneck appears to occur in the TiffReader getTiffRawImageData method which reads raw data from the file in preparation of creating a BufferedImage object.
> I suspect that there may be a general slowness of file access.  In debugging, even reading the initial metadata (22 TIFF tags) took a couple of seconds.  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)