forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: Speed (was Re: Forrest 0.5 outstanding issues...))
Date Tue, 17 Jun 2003 12:42:19 GMT
On Mon, Jun 16, 2003 at 07:52:40PM +0200, Nicola Ken Barozzi wrote:
...
> Ok, done some profiling.
> Attached is the result for a page.
> 
> First of all, there is a lot of difference between the first invocation
> and the 4,5th one, that takes 50% less time. This happens also with the
> non-caching pipeline, even if in the report there is not anymore as I
> exceeded 10 calls (believe me).
> 
> But the major thing that I see is this in the non-caching body-index.html.
> 
>   20+1+1+39+49+3 != 355 !!!!
> 
> There are 242ms missing! Wierd, huh?

Even weirder, if you add up the times:

130 body-index.html
50  menu-index.html
28  tab-index.html
210 site2xhtml

That adds up to 418ms, but the page total is around 1s.  So over half our
time is being lost somewhere inside Cocoon or Jetty.

Wild hypothesising..

You said that hprof indicated that Xalan was taking a lot of time.
Perhaps Avalon is doing lots of Xalan setups/teardowns, instead of
properly reusing the transformer, and this time isn't logged, as it is
done before the XSLT transformer is invoked...

The performance issue I was _expecting_ to cause trouble is the frequent
use of 'cocoon:' URLs.  Flattened out, we have:

<map:match pattern="*.html">
  <map:aggregate>
    <map:part src="cocoon:/body-{1}.html"/>
    ...
  <map:serialize type="html"/>
</map:match>

<map:match pattern="body-*.html">
  <map:generate src="cocoon://{1}.xml"/>
  ...
  <map:serialize type="xml"/>
</map:match>

<map:match pattern="*.xml">
  <map:generate src="content/xdocs/{0}"/>
  ...
  <map:serialize type="xml"/>
</map:match>

So for every URL, we create, serialize and reparse a DOM, twice.

In general, I think that the number of XSLTs applied is only going to
increase in the future.  In particular, I was thinking we could implement
a macro facility (a modern replacement for entities), eg,
<cocoon:version/> being replaced with '2.1-dev'.  Each macro can be
implemented as a stylesheet (probably STX).


--Jeff

Mime
View raw message