xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: problems with times
Date Wed, 21 Sep 2005 09:07:52 GMT
I assume the operating system has very little influence on the time here.
The fact that ALi has a big difference in the first couple of
invocations is a clear indicator that he experiences the effect of class
loading and just-in-time compiling by the JavaVM. And yes, ALi, the
stylesheets have to be "compiled" (or at least parsed) but I guess from
your code that this happens each time in your case. Unfortunately, we
don't see the code of your makePDF() method.

You can reuse the "pre-compiled" XSLT stylesheet if you use the JAXP
Templates object. Please note that it's not FOP that compiles the XSLT
stylesheet. It's probably you in makePDF() by using JAXP. FOP only
processes the output of the XSL transformation. There are lots of
articles on the web (like the following) that demonstrate how to cache
Templates instances: http://www.javaworld.com/javaworld/jw-05-2003/jw-0502-xsl.html

On 21.09.2005 10:22:22 Manuel Mall wrote:
> Are you sure its not your operating system which causes the time 
> differences. Even OSes tend to warm up, ie. the first time around 
> existing stuff gets swapped out and the new code loaded. Next time 
> around this is not required any more.
> 
> Manuel
> 
> On Wed, 21 Sep 2005 04:07 pm, ALi wrote:
> > Hello i have problems with times in generating pdf
> > I want to know why the times are so different between one invocation
> > and two
> >
> >
> > for example i have the class makePDF
> >
> > main () {
> >    time1
> >    makePDF(xml,xsl);
> >    time2
> >    println(time2-time1)
> > }
> > the times are over 8 seconds
> > more or less (with my xsl)
> >
> > if i have
> > main () {
> > for (1-10) {
> >    time1
> >    makePDF(xml,xsl);
> >    time2
> >    println(time2-time1)
> > }
> > }
> >
> > the first time is 8 seconds, but the seconds ones are less but much
> > less the second is 3 seconds the third 1500 miliseconds and after
> > over 300 miliseconds .....
> > why is these? is it because the fop need to compile the xsl? Are any
> > form to force to cache the compilation of xsl? (in order to always
> > take the same time.
> >
> > We have different xsl and one class that makes alls
> >
> >
> > thx for your help



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message