Re: Re: Templating engines
| From: | Burhan Khalid | Date: | Sun, 03 Jul 2005 07:24:45 +0000 |
| Subject: | Re: Re: Templating engines | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218050@lists.php.net to get a copy of this message | ||
Robert Cummings wrote:
On Fri, 2005-04-29 at 23:55, Rasmus Lerdorf wrote:Hey Robert -- can you give an example of one that does this? I'm just curious as I haven't seen many that do this.Robert Cummings wrote:This isn't a problem for engines that compile to PHP source that has direct hooks into the necessary data structures that will contain the data at run time. Smarty isn't one of them though :)I don't think that templates have a dependency between the number of pages using the template and an increase in the number of functions. In fact depending on the template, and the template engine, you can have 500 pages using the template and not a single function call. Including the elimination of include() and include_once() calls since if the template engine compiles to PHP it can do the includes at compile time rather than punting to PHP to do at run-time.While compiling to PHP is by far superior to the various terrible eval() and regex-based templating layers out there, it is still dog-slow compared to tight specialized PHP code. Just instantiating the base Smarty class, for example, takes a very long time. I optimized a Smarty site a while back where I got a 50% speedup by migrating the base Smarty class to C in an extension.