> I've noticed a bit of chat on the list the last few days concerning
> performance. I'm having a few problems in that area and I wondered if anyone
> had any suggestions. I have a 16 page document, consisting of text and
> embedded images, which is presently taking 30 seconds to generate. I've
> tried Mark's Fop.jar, which saves me about 4 to 6 seconds on this, but it
> still seems excessive. I think it has everything to
> do with the way I am invoking FOP.
> I'm calling fop from the command line, using the runnable Jar. The call
> looks like this:
> d:\jdk\bin\java.exe -classpath
> d:\jdk\lib\tools.jar;d:\jdk\lib\classes.zip;d:\fop\lib\ant.jar;d:\fop\lib\w3
> c.jar;d:\fop\lib\buildtools.jar;d:\fop\lib\xerces-1.2.3.jar;d:\fop\lib\xalan
> -2.0.0.jar;d:\fop\lib\xalanj1compat.jar;d:\fop\lib\bsf.jar;d:\fop\lib\jimi-1
> .0.jar;d:\fop\fop.jar;d:\fop\lib\xerces.jar;d:\fop\lib\xalan.jar;d:\fop\lib\
> bsf.jar -jar d:\fop\fop.jar -xml test.xml -xsl test.xsl -pdf test.pdf
> The class path came from the RunTest.bat, which was the only example that I
> could find at the time. There's probably all sorts of things in there that I
> don't need.
> When we first started playing with FOP, it was with Cocoon. The document we
> were testing with was only 5 pages, but the processing time was much less,
> only a few seconds. Because the cocoon distributable didn't cme with the
> latest FOP, and we wanted to use v0.19, we went for the command line option.
> It also fits in better with how we are using FOP. 
> I apologise for being a Java ignoramus, but can anyone give me a pointer on
> what might be happening here?

That's because you're starting a new VM for every document you're
creating. First the VM is started (expensive operation), then all
classes have to be loaded which also takes a long time. Processing in
Cocoon was faster because all FOP classes were already loaded after the
first call. How to improve your situation depends on how FOP fits into
your project.

If your application is written in Java, I encourage you to look at
http://xml.apache.org/fop/embedding.html to see how to embed FOP into
your application. Of course, that means taking fop.jar and a few other
jars into your project class path.

Unfortunately, the page above only shows how to call FOP. The part where
XSLT comes into play is missing. I think you will find material on that
in the mailing list archive. Probably, this page will have to be
improved. Volunteers?

Jeremias Märki


Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to