[Yanel-dev] Performance Thoughts about XSLT

Michael Wechner michael.wechner at wyona.com
Mon Nov 5 14:03:29 CET 2012


Dear Balz

Am 05.11.12 11:43, schrieb basZero:
> dear all,
>
> I wonder the following and I'd be interested to hear your thoughts 
> about it:
>
> When creating a resource which is subclassed of Yanel's 
> BasicXMLResource, the following happens:
>
> - getView() gets called by Yanel
> - then the resource's getContentXML() gets called: here you prepare 
> the XML document that at the end is passed to the XSL transformation
> - getTransformedInputStream() gets called: here the actual XSLT is 
> performed.
>
> I wonder the following regarding performance:
>
> - the XSLT process includes the transformation of XSL files into Java 
> template objects.
> - The creation of such template objects certainly takes time and is 
> probably done for every request
>
> What can be done to reduce the time needed for the XSLT part of a 
> request time?

Yanel currently uses Xalan 2.7.0, whereas it might make sense to upgrade 
to 2.7.1.

Also I assume that Yanel currently is using the interpreter instead 
XSLTC. See

http://marc.info/?l=xalan-j-users&m=122551369713293

but I guess we could change it rather easily or make it configurable 
somehow. (whereas we should check first what it is really using ;-)
>
> - Did anybody use precompiled templates (e.g.: the XSLT transformer 
> only compiles the XSL, if it has changed since the last compilation), 
> I read some articles about this pre-compilation topic which should 
> boost the whole XSLT time dramatically
> - Split up include files into smaller ones?
>
> Generally asking:
> - Did you do anything specifically regarding performance of XSLT?

no, because so far the XSLT was never the real problem. In most cases 
the bottleneck was rather the custom code, e.g.
code which generated the XML to start with, but which didn't scale for 
whatever reasons.
> - If so, what did you apply?

My suggestion is to first check whether Yanel is using interpreter or 
XSLTC and if interpreter, then try to switch to XSLTC.

Depending on how dynamic your page is, you could of course generate 
static files (with a double buffer) and then server them from the 
filesystem of even from the memory. (and maybe include the dynamic parts).

HTH

Michael
>
> Cheers
> Balz
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wyona.org/pipermail/yanel-development/attachments/20121105/bbd2e940/attachment.html>


More information about the Yanel-development mailing list