If you transform your XML to PDF using fop.bat you're starting one JVM.
If you're calling the Xalan command line to generate the XSL-FO and then
you invoke fop.bat with -fo to get the PDF, then you're starting two
JVMs. It is very strange that it seems to be faster to start two VMs
than to do the two transformations in one run (connected through SAX
events). But this might be some strange side-effect from
JVM-starting/class-loading. I'm sure this would look differently if you
had a server app that can do multiple transformation runs without having
to restart the JVM each time. The whole thing should (I'm getting
cautious) be a lot faster by the way.

Anyone there with Java knowledge and some time and curiosity who wants
to analyze this a little more?

On 24.01.2003 16:29:22 Clay Leeds wrote:
> Jeremias Maerki wrote:
> > As Jörg said, you have to take JVM startup into account. That makes the
> > whole thing relatively unpredictable. Measuring times from batch files
> > is ok to get a general idea but not for investigating details. For that
> > you have to write a Java program and execute the transformations several
> > times to make sure all classes are loaded (a lengthy process) and the
> > JVM had a chance to compile some Java code into machine code for faster
> > execution (HotSpot JIT compiler).
> > 
> > On 23.01.2003 23:34:03 Clay Leeds wrote:
> > 
> >>That's an intriguing idea. Assuming that it would help trouble-shoot 
> >>problems like this, that might be good for this type of testing. Also, I 
> >>noticed a difference in the amount of time, when FOP transformed & 
> >>rendered the PDF file from start to finish (01:05 for 0.20.4), versus 
> >>when xalan-2.0.1 transformed to XML, and then FOP transformed what was 
> >>essentially an FO file to PDF (47030ms+1843ms=48873ms). Any idea where 
> >>the additional 15+ seconds went?
> > 
> > Jeremias Maerki
> 
> Not trying to belabor a point, just trying to get understanding of how 
> this all works. I would think that JVM only has to start once during a 
> processing instance. I wouldn't think that it would matter if the intial 
> factor is 1) a *.bat file that initiates FOP (which runs XALAN, XERCES, 
> etc.); or 2) if it's a *.bat file that initiates FOP and then another 
> *.bat file that intiates FOP from the generated FO file. The way I 
> figure it, option 1 launches JVM once, whereas option 2 launches JVM 
> twice (one for each *.bat file). However, my results showed that I 
> would've saved 18 seconds if I used a *.bat file which launched my two 
> *.bat files. I realize that my results were anything but scientific, as 
> I eyeballed the Windows system clock instead of using cygwin's TIME()).


Jeremias Maerki


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

Reply via email to