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

[email protected] (George Schlossnagle) Thu, 14 Oct 2004 10:15:21 -0400
Newsgroups php.xml.dev
Message-ID <[email protected]>
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.

George