Re: [PHP-XML-DEV] XSL vs. Smary

[email protected] (George Schlossnagle) Mon, 18 Oct 2004 09:32:28 -0400
Newsgroups php.xml.dev
Message-ID <[email protected]>
On Oct 18, 2004, at 2:01 AM, Christian Stocker wrote:

>
>
> On 14.10.2004 16:15 Uhr, George Schlossnagle wrote:
>> On Oct 14, 2004, at 3:06 AM, Philipp Melab wrote:
>>> I am building a small, extensible CMS-System for a bunch of simple 
>>> websites (gallery, guestbook, articles... < 20MB) I have to create. 
>>> To reuse the system i need some kind of template engine. At the 
>>> moment I'm stuck between smarty and XSL.
>>> I already worked with XSL, so the complexity isnt a factor. Im 
>>> thinking about implementing the system with JSP, Servlets too, which 
>>> would make XSL the better choice too.
>>> What i need to know is the performance factor. Is far as i 
>>> understood, XSL-Tranformations are running natively, but they have 
>>> to be compiled everytime. Smarty-Templates are compiled and cached.
>>> So, which one is faster?
>> You should benchmark these on your templates.  I'm using (the yet 
>> unreleased) fastxsl extension, whose comppiled stylesheet features 
>> will hopefully be added into php5's xsl extension (they have very 
>> compatible architectures).  Using that, the transforms were much 
>> faster that I expected.  On moderately complex templates, using real 
>> world data, I was seeing a total templatization time of around 0.01 
>> seconds per page, and had no problems satisfying my performace 
>> requirement of 30 pages/second sustained.
>
> I finally looked again at the fastxsl extension. The idea still looks 
> promising and I think, we could integrate that somehow in the standard 
> xsl extension (not decided about the API yet and thread issues..)
>
> Just one question: It doesn't look like XSLT files included with 
> xsl:include|import are cached, or am I missing something?

They are.  In fact, they're cached all too well - they're included in 
the memory allocation for the principal stylesheet.  Options for that 
are being considered.

George