You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Marco Spinetti <m....@pisa.iol.it> on 2001/01/26 16:20:19 UTC
R: PERFORMANCE PROBLEM! (for Donald)
Hi Donald,
excuse me but I think I have not understood. Do you advise me to implement a
HasChange method in my Xsp page and add my Xsl file the code you have sent
me?
But doing so I add a Xsp transformation to my Xsl file which there was
before not.
Very probably I have not understood: can you better explain it to me?
Regards
Marco
m.spinetti@pisa.iol.it
----- Original Message -----
From: Donald Ball <ba...@webslingerZ.com>
To: <co...@xml.apache.org>
Sent: Thursday, January 25, 2001 9:19 PM
Subject: Re: PERFORMANCE PROBLEM!
> On Thu, 25 Jan 2001, Marco Spinetti wrote:
>
> > Hi all, my question is how I can increase my system performances. I
> > have built a multiterminal Xml portal based on Cocoon: in the service
> > of meteo forecasts for every request my system uses 1,6 second: using
> > the Profiler.xml file I found out that this time is so subdivided:
> >
> > 36 ms (org-apache-cocoon-producer-ProducerFromFile)
> > 408 ms (org.apache.cocoon.processor.xsp.XSPProcessor)
> > 938 ms (org.apache.cocoon.processor.xslt.XSLTProcessor-1)
> > 247 ms (org-apache-cocoon-formatter-HTMLFormatter)
> > 54 ms (Outputting)
>
> you can eliminate almost all of this time by having your xsp pages
> implement a hasChanged method. i use this template in my main
> site-specific logicsheet to seamlessly add one to all of my xsp pages:
>
> <xsl:template match="xsp:page">
> <xsl:copy>
> <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
> <xsp:logic>
> static long last_changed_millis = 0;
> static final long MILLISECONDS_TO_CACHE = 5*60*1000;
>
> public boolean hasChanged(Object context) {
> long current_millis = System.currentTimeMillis();
> if (current_millis - MILLISECONDS_TO_CACHE > last_changed_millis)
{
> last_changed_millis = current_millis;
> return true;
> } else {
> return false;
> }
> }
> </xsp:logic>
> </xsl:copy>
> </xsl:template>
>
> this causes xsp output to cache for a five minutes at a time. it gave me a
> speedup of over an order of magnitude.
>
> - donald
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>