Bug 48013 - Image processing makes FOP really slow
Summary: Image processing makes FOP really slow
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.95
Hardware: PC Windows XP
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-16 11:44 UTC by Jonathan Levinson
Modified: 2012-04-07 01:51 UTC (History)
0 users



Attachments
image testing file (1.90 KB, application/octet-stream)
2009-10-16 11:44 UTC, Jonathan Levinson
Details
Image used (21.48 KB, image/png)
2009-10-16 11:44 UTC, Jonathan Levinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Levinson 2009-10-16 11:44:13 UTC
Created attachment 24385 [details]
image testing file

In investigating a problem in the display of PNG images in FOP, I discovered
that image processing was really slow.

Examining the code in a debugger the surprise is that the source of slowness is
not the rendering of the image (which is done through Java’s JAI) but in the
steps leading up to the rendering of the image.

For a simple FO page, with a single PNG image FOP takes 90 seconds.  Remove the
image and FOP takes 1 second.  RenderX takes a second as well with our without
the image.

So the addition of a single image to an FO page results in extreme slowness –
two orders of magnitude slower than RenderX XEP.
Comment 1 Jonathan Levinson 2009-10-16 11:44:41 UTC
Created attachment 24386 [details]
Image used

Image used
Comment 2 Sean Griffin 2009-10-19 07:16:33 UTC
Can you describe what steps leading up to the rendering that you identified as the slow points?  Also maybe more about your environment (max heap, etc.).

I tried this myself with just the default max heap size and was able to create the PDF in under 0.5 sec using the client Hotspot JVM.
Comment 3 Jonathan Levinson 2009-10-19 11:13:56 UTC
I am on Windows XP with 3.5 Gig of memory.  I am running on a Dell Latitude D630 laptop.  Dual Core.  2.6 GHz.

C:\jai-1_1\lib>java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

I have JAI 1.1.3 installed and am able to run the demos.

Right now, I can't get fop-0.95 to display the image because I get the error:

SEVERE: Image not available: No ImagePreloader found for file:///perforce/Users/levinson/B47157/test-image.png
Comment 4 Jonathan Levinson 2009-10-22 11:59:13 UTC
Fixed in patch.
http://svn.apache.org/viewvc?rev=828814&view=rev
Comment 5 Eric 2010-03-10 19:41:14 UTC
(In reply to comment #4)
> Fixed in patch.
> http://svn.apache.org/viewvc?rev=828814&view=rev

The problem reported is with FOP.  This patch is for the xmlgraphics project.  The download for FOP 0.95 includes an xmlgraphics jar.  Is it recommended to use newer versions of the projects referenced by FOP than the ones it comes with?

Is there a compiled download of the trunks or are they just source?  Should the xmlgraphics trunk be used with the FOP trunk?
Comment 6 Chris Bowditch 2010-03-11 11:49:34 UTC
There are no builds of trunk FOP available. Just the source, so you have to download from SVN and build locally.

You have to keep FOP and xgc versions in sync. So if you want to use trunk xgc then you will have to use trunk FOP as well.
Comment 7 Vincent Hennebert 2010-03-11 12:00:01 UTC
(In reply to comment #6)
> There are no builds of trunk FOP available. Just the source, so you have to
> download from SVN and build locally.

Actually, nightly builds are available there:
FOP: http://vc.apache.org/snapshots/fop/
XML Graphics: http://vc.apache.org/snapshots/xmlgraphics-commons/
Comment 8 Chris Bowditch 2010-03-11 12:23:41 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > There are no builds of trunk FOP available. Just the source, so you have to
> > download from SVN and build locally.
> Actually, nightly builds are available there:
> FOP: http://vc.apache.org/snapshots/fop/
> XML Graphics: http://vc.apache.org/snapshots/xmlgraphics-commons/


It's great that we've restored the overnight builds. I've added a link on the FOP website in revision 921823. Probably need to do the same for xgc too so that we avoid confusion in the future.
Comment 9 Glenn Adams 2012-04-07 01:41:56 UTC
resetting P2 open bugs to P3 pending further review