You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Karl Øie <ka...@gan.no> on 2001/08/22 19:54:53 UTC

performance tuning...

Hi, I have a very standard pipeline for my project. The file
"oversikten.xml" is filtered through the stylesheet
"oversikten.xsl" which uses parameters sent to it to filter/rearrange the
output.

	<map:match pattern="page.html">
		<map:generate src="sources/oversikten.xml"/>
		<map:transform src="oversikten.xsl">
			<map:parameter name="use-request-parameters" value="true"/>
		</map:transform>
   		<map:serialize type="html"/>
	</map:match>

The file "oversikten.xml" is about 4mb large, and the site performs quite
badly. Is there any tips for improving the performance short of splitting
the file into smaller parts as this I am not allowed to do that.

mvh karl øie


---------------------------------------------------------------------
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>


RE: performance tuning... (match="id(xxx)" versus match="//*[@id=xxx]")

Posted by Karl Øie <ka...@gan.no>.
wget timings of match="id(xxx)" versus match="//*[@id=xxx]":
------------------------------------------------------------

time wget http://saturn.gan.no:8888/mup/xpath.xsp?xpath=KAP1 - 0m14.686s
(first hit)
time wget http://saturn.gan.no:8888/mup/xpath.xsp?xpath=KAP1 - 0m0.030s
(second hit)

time wget http://saturn.gan.no:8888/mup/id.xsp?id=KAP1 - 0m5.882s (first
hit)
time wget http://saturn.gan.no:8888/mup/id.xsp?id=KAP1 - 0m0.012s (second
hit)


these stats show that Joerg's tips about using a id() lookup instead of a
xpath lookup upon id attributes was correct, id() performed 2,5 times better
on first hit, and also on cached result. I will now start to edit all my XML
files and use id() lookup instead! thanks!!!

mvh Karl Xie



> Can you give us a feed back? ;)
>
> Thanks,
>
> --Arnaud



> If you have a DTD for your XML and your @id is really unique in the whole
> XML, you can use the id()-function of XPATH. Instead of "//*[@id='1222']"
> use "id('1222')". This takes much less time than your statement (around
> factor 10; of course dependent on the size of the XML, my XML was
> 150 KB ->
> maybe better factor for you).
>
> Joerg


---------------------------------------------------------------------
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>


Re: performance tuning...

Posted by Jörg Heinicke <jh...@virbus.de>.
Karl Øie wrote:

> wget timing:
> ------------
> first run of "toc.html" -> 41.879s
> second run of "toc.html" -> 0.013s (!!!)
> 
> first run of "page.html?xpath=//*[@id='1222']" -> 58.031s
> second run of "page.html?xpath=//*[@id='1222']" -> 0.017s (!!!)

Hi Karl,

maybe I have another proposal for you:

If you have a DTD for your XML and your @id is really unique in the whole 
XML, you can use the id()-function of XPATH. Instead of "//*[@id='1222']" 
use "id('1222')". This takes much less time than your statement (around 
factor 10; of course dependent on the size of the XML, my XML was 150 KB -> 
maybe better factor for you).

Joerg


---------------------------------------------------------------------
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>


RE: performance tuning...

Posted by Karl Øie <ka...@gan.no>.
how do i set up c2 to precompile?

mvh karl



Hi.,
  I am not sure about everything else but the "first
hit stuff"..

  It is possible to greatly reduce the "first hit"
time by having the c2 pre-compiled...This reduced the
"first-hit" time greately for me...(specially i have
lots of xsps)..



 --- Karl_Øie <ka...@gan.no> wrote: > I am sorry, I
really should have thought of that!,
> here we go:-)
>
> my system is:
> -------------
> - dual Pentium 1ghz
> - 4 gb ram
> - 2 speedraided ldv 9gb scsi disks
> - linux slackware 8
> - sun sdk 1.3.1
> - tomcat 3.2.3
> - xalan 2.2.d9
> - xerces 1.4.3
>
>
> wget timing:
> ------------
> first run of "toc.html" -> 41.879s
> second run of "toc.html" -> 0.013s (!!!)
>
> first run of "page.html?xpath=//*[@id='1222']" ->
> 58.031s
> second run of "page.html?xpath=//*[@id='1222']" ->
> 0.017s (!!!)
>
>
> questions:
> ----------
> as you can see the cache works great for a few
> pages, but the first hit
> takes a lot of time, so is it possible to hit every
> page at startup so the
> first visitors don't have to suffer?
>
> how can I tune my cache settings? I have tried with
> this:
>
>   <store
>
class="org.apache.cocoon.components.store.MRUMemoryStore">
>      <parameter name="freememory" value="1000000"/>
>      <parameter name="heapsize" value="600000000"/>
>      <parameter name="cleanupthreadinterval"
> value="10"/>
>      <parameter name="maxobjects" value="100"/>
>      <parameter name="usecleanupthread"
> value="true"/>
>      <parameter name="threadpriority" value="5"/>
>      <parameter name="filesystem" value="true"/>
>   </store>
>
> but it doesn't really cut the cheese, after a some
> usage the site starts to
> regenerate the pages again, and the visitors will
> have to wait for nearly a
> minute for each call...
>
> am I doing something wrong here?
>
>
>
> mvh karl øie
>
>
>
>
>
> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: 22. august 2001 21:53
> To: cocoon-users@xml.apache.org
> Subject: Re: performance tuning...
>
>
> Karl Øie wrote:
> >
> > Hi, I have a very standard pipeline for my
> project. The file
> > "oversikten.xml" is filtered through the
> stylesheet
> > "oversikten.xsl" which uses parameters sent to it
> to filter/rearrange the
> > output.
> >
> >         <map:match pattern="page.html">
> >                 <map:generate
> src="sources/oversikten.xml"/>
> >                 <map:transform
> src="oversikten.xsl">
> >                         <map:parameter
> name="use-request-parameters"
> value="true"/>
> >                 </map:transform>
> >                 <map:serialize type="html"/>
> >         </map:match>
> >
> > The file "oversikten.xml" is about 4mb large, and
> the site performs quite
> > badly. Is there any tips for improving the
> performance short of splitting
> > the file into smaller parts as this I am not
> allowed to do that.
>
>
> What are the numbers your are targeting?  (i.e. how
> fast do you need it?)
> What kind of hardware are you using?
> What are the current numbers you are getting? (i.e.
> how slow is it now?)
>
> To really help you, we need these questions
> answered.
>
> If you are using the Caching Pipeline, you should be
> able to experience
> better
> performance each time you request it.  However, if
> your cache is set too
> small
> to keep the entire XML in memory, the cache will be
> of no benefit.
>
> How complicated are the XSLT stylesheets?  If you
> are not using global
> variables
> or parameters, that speeds things up.
>
>
---------------------------------------------------------------------
> 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>
>
>
>
---------------------------------------------------------------------
> 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>
>

=====
Thanks and have great day
srini

____________________________________________________________
Do You Yahoo!?
Send a newsletter, share photos & files, conduct polls, organize chat
events. Visit http://in/ groups.yahoo.com

---------------------------------------------------------------------
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>


---------------------------------------------------------------------
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>


RE: performance tuning...

Posted by java guru <ja...@yahoo.co.in>.
Hi.,
  I am not sure about everything else but the "first
hit stuff"..

  It is possible to greatly reduce the "first hit"
time by having the c2 pre-compiled...This reduced the
"first-hit" time greately for me...(specially i have
lots of xsps)..



 --- Karl_Øie <ka...@gan.no> wrote: > I am sorry, I
really should have thought of that!,
> here we go:-)
> 
> my system is:
> -------------
> - dual Pentium 1ghz
> - 4 gb ram
> - 2 speedraided ldv 9gb scsi disks
> - linux slackware 8
> - sun sdk 1.3.1
> - tomcat 3.2.3
> - xalan 2.2.d9
> - xerces 1.4.3
> 
> 
> wget timing:
> ------------
> first run of "toc.html" -> 41.879s
> second run of "toc.html" -> 0.013s (!!!)
> 
> first run of "page.html?xpath=//*[@id='1222']" ->
> 58.031s
> second run of "page.html?xpath=//*[@id='1222']" ->
> 0.017s (!!!)
> 
> 
> questions:
> ----------
> as you can see the cache works great for a few
> pages, but the first hit
> takes a lot of time, so is it possible to hit every
> page at startup so the
> first visitors don't have to suffer?
> 
> how can I tune my cache settings? I have tried with
> this:
> 
>   <store
>
class="org.apache.cocoon.components.store.MRUMemoryStore">
>      <parameter name="freememory" value="1000000"/>
>      <parameter name="heapsize" value="600000000"/>
>      <parameter name="cleanupthreadinterval"
> value="10"/>
>      <parameter name="maxobjects" value="100"/>
>      <parameter name="usecleanupthread"
> value="true"/>
>      <parameter name="threadpriority" value="5"/>
>      <parameter name="filesystem" value="true"/>
>   </store>
> 
> but it doesn't really cut the cheese, after a some
> usage the site starts to
> regenerate the pages again, and the visitors will
> have to wait for nearly a
> minute for each call...
> 
> am I doing something wrong here?
> 
> 
> 
> mvh karl øie
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: 22. august 2001 21:53
> To: cocoon-users@xml.apache.org
> Subject: Re: performance tuning...
> 
> 
> Karl Øie wrote:
> >
> > Hi, I have a very standard pipeline for my
> project. The file
> > "oversikten.xml" is filtered through the
> stylesheet
> > "oversikten.xsl" which uses parameters sent to it
> to filter/rearrange the
> > output.
> >
> >         <map:match pattern="page.html">
> >                 <map:generate
> src="sources/oversikten.xml"/>
> >                 <map:transform
> src="oversikten.xsl">
> >                         <map:parameter
> name="use-request-parameters"
> value="true"/>
> >                 </map:transform>
> >                 <map:serialize type="html"/>
> >         </map:match>
> >
> > The file "oversikten.xml" is about 4mb large, and
> the site performs quite
> > badly. Is there any tips for improving the
> performance short of splitting
> > the file into smaller parts as this I am not
> allowed to do that.
> 
> 
> What are the numbers your are targeting?  (i.e. how
> fast do you need it?)
> What kind of hardware are you using?
> What are the current numbers you are getting? (i.e.
> how slow is it now?)
> 
> To really help you, we need these questions
> answered.
> 
> If you are using the Caching Pipeline, you should be
> able to experience
> better
> performance each time you request it.  However, if
> your cache is set too
> small
> to keep the entire XML in memory, the cache will be
> of no benefit.
> 
> How complicated are the XSLT stylesheets?  If you
> are not using global
> variables
> or parameters, that speeds things up.
> 
>
---------------------------------------------------------------------
> 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>
> 
> 
>
---------------------------------------------------------------------
> 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>
>  

=====
Thanks and have great day
srini

____________________________________________________________
Do You Yahoo!?
Send a newsletter, share photos & files, conduct polls, organize chat events. Visit http://in/ groups.yahoo.com

---------------------------------------------------------------------
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>


RE: performance tuning...

Posted by Karl Øie <ka...@gan.no>.
I am sorry, I really should have thought of that!, here we go:-)

my system is:
-------------
- dual Pentium 1ghz
- 4 gb ram
- 2 speedraided ldv 9gb scsi disks
- linux slackware 8
- sun sdk 1.3.1
- tomcat 3.2.3
- xalan 2.2.d9
- xerces 1.4.3


wget timing:
------------
first run of "toc.html" -> 41.879s
second run of "toc.html" -> 0.013s (!!!)

first run of "page.html?xpath=//*[@id='1222']" -> 58.031s
second run of "page.html?xpath=//*[@id='1222']" -> 0.017s (!!!)


questions:
----------
as you can see the cache works great for a few pages, but the first hit
takes a lot of time, so is it possible to hit every page at startup so the
first visitors don't have to suffer?

how can I tune my cache settings? I have tried with this:

  <store class="org.apache.cocoon.components.store.MRUMemoryStore">
     <parameter name="freememory" value="1000000"/>
     <parameter name="heapsize" value="600000000"/>
     <parameter name="cleanupthreadinterval" value="10"/>
     <parameter name="maxobjects" value="100"/>
     <parameter name="usecleanupthread" value="true"/>
     <parameter name="threadpriority" value="5"/>
     <parameter name="filesystem" value="true"/>
  </store>

but it doesn't really cut the cheese, after a some usage the site starts to
regenerate the pages again, and the visitors will have to wait for nearly a
minute for each call...

am I doing something wrong here?



mvh karl øie





-----Original Message-----
From: Berin Loritsch [mailto:bloritsch@apache.org]
Sent: 22. august 2001 21:53
To: cocoon-users@xml.apache.org
Subject: Re: performance tuning...


Karl Øie wrote:
>
> Hi, I have a very standard pipeline for my project. The file
> "oversikten.xml" is filtered through the stylesheet
> "oversikten.xsl" which uses parameters sent to it to filter/rearrange the
> output.
>
>         <map:match pattern="page.html">
>                 <map:generate src="sources/oversikten.xml"/>
>                 <map:transform src="oversikten.xsl">
>                         <map:parameter name="use-request-parameters"
value="true"/>
>                 </map:transform>
>                 <map:serialize type="html"/>
>         </map:match>
>
> The file "oversikten.xml" is about 4mb large, and the site performs quite
> badly. Is there any tips for improving the performance short of splitting
> the file into smaller parts as this I am not allowed to do that.


What are the numbers your are targeting?  (i.e. how fast do you need it?)
What kind of hardware are you using?
What are the current numbers you are getting? (i.e. how slow is it now?)

To really help you, we need these questions answered.

If you are using the Caching Pipeline, you should be able to experience
better
performance each time you request it.  However, if your cache is set too
small
to keep the entire XML in memory, the cache will be of no benefit.

How complicated are the XSLT stylesheets?  If you are not using global
variables
or parameters, that speeds things up.

---------------------------------------------------------------------
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>


---------------------------------------------------------------------
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>


Re: performance tuning...

Posted by Berin Loritsch <bl...@apache.org>.
Karl Øie wrote:
> 
> Hi, I have a very standard pipeline for my project. The file
> "oversikten.xml" is filtered through the stylesheet
> "oversikten.xsl" which uses parameters sent to it to filter/rearrange the
> output.
> 
>         <map:match pattern="page.html">
>                 <map:generate src="sources/oversikten.xml"/>
>                 <map:transform src="oversikten.xsl">
>                         <map:parameter name="use-request-parameters" value="true"/>
>                 </map:transform>
>                 <map:serialize type="html"/>
>         </map:match>
> 
> The file "oversikten.xml" is about 4mb large, and the site performs quite
> badly. Is there any tips for improving the performance short of splitting
> the file into smaller parts as this I am not allowed to do that.


What are the numbers your are targeting?  (i.e. how fast do you need it?)
What kind of hardware are you using?
What are the current numbers you are getting? (i.e. how slow is it now?)

To really help you, we need these questions answered.

If you are using the Caching Pipeline, you should be able to experience better
performance each time you request it.  However, if your cache is set too small
to keep the entire XML in memory, the cache will be of no benefit.

How complicated are the XSLT stylesheets?  If you are not using global variables
or parameters, that speeds things up.

---------------------------------------------------------------------
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>