cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <>
Subject Re: Speed of jx-macros compared to FormsTransformer
Date Tue, 17 May 2005 08:29:25 GMT
Daniel Fagerstrom wrote:
> Reinhard Poetz wrote:
>> Sylvain Wallez wrote:
> <snip/>
>>> Ah no, forgot to say: this requires to use JXTemplate and the 
>>> forms-template-as-jx-macros.
>> Today I've run some load tests that compare Cocoon Forms using 
>> jx-macros and the FormsTransformer. The transformer is *considerably* 
>> faster (~ factor of 3!) than the macros and the higher the load the 
>> better for the transformer.
>> Is there any special reason for this? 
> Macros has been reported to be slow before, IIRC. There is no reason 
> that they should be, maybe they not are cached as they should be? Leszek 
> has made the latest refactorings on the macros so he might have more 
> info. 

yes please, Leszek, any ideas?

> The template and the macros should be much faster the second time 
> they are execute, otherwise there is some problem with template caching. 
> Do you have any numbers on  that?

yes they are but macro execution takes still too long (IMHO)

> Besides that does a lot of function calls through Jexl, that requires 
> reflection an might be costly.

hmmm, can't confirm this (but this is only my interpretation of the profiling 
data and I'm *not* a profiling specialist)

> Generally a large part of the work is done at compile time, so it should 
> at least in principle be efficient.
> But of course there can be bottle necks in different parts. We need 
> profiling info to know where to start optimizing. Do you have any 
> indication on where most of the time is spend?

AFAICS there is a lot of time spent in the macro execution methods and 
especially in org.apache.cocoon.template.jxtg.script.Invoker.toDOMNodeList()

>> Any chance to speed up JX?
> Sure, give us profiling data ;)

here there are YourKit profiling data:

  - I always called http://localhost:8888/samples/blocks/forms/form1
    once for the snapshots (controller is an action)
  - I commented out the XSLT-Transformer and the i18nTransformer
  - an initial request is the first call of an Cocoon Forms and a JXTemplate
  - a *non*-initial requests is done after some "warming-up" requests

and here there is an HTML export of the org.apache.cocoon.template method calls 
in the example that uses jx-macro in a subsequent call:

Does this help?

Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}


View raw message