You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2011/05/04 12:16:18 UTC

DO NOT REPLY [Bug 51149] New: 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

             Bug #: 51149
           Summary: 20x slowdown in PNG processing when switching from JDK
                    1.6.0_17 to 1.6.0_18
           Product: Fop
           Version: 1.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: images
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: ognjen.d.blagojevic@gmail.com
    Classification: Unclassified


Created attachment 26958
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=26958
Example image, intentionally blurred

This issue is discussed at the thread with the same name:

http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/201103.mbox/%3C4D7A0D5B.4010500@gmail.com%3E


Summary:

PNG image sized 2035x1875 pixels, with color profile "sRGB IEC61966-2.1", takes
2s to process at Sun/Oracle JDK 1.6.0_17 and 40s at 1.6.0_18 or later.

Please read thread for details.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

--- Comment #1 from patches@portaildulibre.fr 2011-06-15 13:31:15 UTC ---
Hello, 
I have a similar bug (fop 1.0), but it doesn't appear in the version 1.3 of
xmlgraphics (fop 0.95).
The problem comes from color model associated with the image.
* if is_sRGB_stdStale = true then getRBG method is very fast
* if is_sRGB_stdStale = false then getRBG  is slow because the treatment is
delegated to ICC_ColorSpace.toRGB

The color model is correct, but it is modified by the class
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO
by the following code (v 1.4): 
            if (providerIgnoresICC && cm instanceof ComponentColorModel) {
                // Apply ICC Profile to Image by creating a new image with a
new
                // color model.
                ICC_Profile iccProf = tryToExctractICCProfile(iiometa);
                if (iccProf != null) {
                    ColorModel cm2 = new ComponentColorModel(
                            new ICC_ColorSpace(iccProf), cm.hasAlpha(), cm
                                    .isAlphaPremultiplied(), cm
                                    .getTransparency(), cm.getTransferType());
                    WritableRaster wr = Raster.createWritableRaster(imageData
                            .getSampleModel(), null);
                    imageData.copyData(wr);
                    BufferedImage bi = new BufferedImage(cm2, wr, cm2
                            .isAlphaPremultiplied(), null);
                    imageData = bi;
                    cm = cm2;

I removed this code and it works fine now, but it's dirty.

Until a fix, best regards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

--- Comment #2 from Chris Bowditch <bo...@hotmail.com> 2012-02-07 08:25:19 UTC ---
We believe this issue was caused by the following change to the JDK:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6549882

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |53055

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|images                      |Image codecs
            Version|1.0                         |1.4
            Product|Fop                         |XMLGraphicsCommons
   Target Milestone|---                         |--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

Ognjen Blagojevic <og...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows XP                  |All

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

Chris Bowditch <bo...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #4 from Chris Bowditch <bo...@hotmail.com> 2012-04-10 16:00:02 UTC ---
Hi Glenn,

Sorry but I don't agree with closing this bug just yet. Whilst its true that
Java changed the implementation and that's what causes the slowdown, FOP still
elects to use that particular JDK library. Luis has been working on a raw PNG
Image Loader that addresses a couple of performance issues. The idea of the new
loader is that it doesn't use the JDK library. 

I would like to leave it open and when Luis returns from vacation in a couple
of days he can test out his new raw PNG handler to see if it alleviates this
particular performance issue.

Thanks,

Chris

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

Glenn Adams <gl...@skynav.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #3 from Glenn Adams <gl...@skynav.com> 2012-04-04 22:47:44 UTC ---
not an FOP bug; upgrade your Java platform to include fix

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |51465

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 51149] 20x slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

--- Comment #5 from Glenn Adams <ga...@apache.org> 2012-04-10 17:25:29 UTC ---
(In reply to comment #4)
> Sorry but I don't agree with closing this bug just yet. Whilst its true that
> Java changed the implementation and that's what causes the slowdown, FOP still
> elects to use that particular JDK library. Luis has been working on a raw PNG
> Image Loader that addresses a couple of performance issues. The idea of the new
> loader is that it doesn't use the JDK library. 
> 
> I would like to leave it open and when Luis returns from vacation in a couple
> of days he can test out his new raw PNG handler to see if it alleviates this
> particular performance issue.

ok, sounds good

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.