On Wed, 21 Sep 2005 05:07 pm, Jeremias Maerki wrote:
> 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
>
Ooops, I didn't express myself very well did I.
Yes, Jeremias description of the problem is much better. What I meant
was that especially Java applications due to the large size of the JVM
suffer from relatively slow startup and initial "warm-up" until a
stable working set (from the OS perspective), ie. a set code and data
pages used by the JVM and application repetitively, has itself
established. Until then one often sees a lot of swapping activity
slowing down the application.
> 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
>
Manuel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]