Smarty - an observation
| From: | clayton collie | Date: | Wed, 07 Feb 2001 14:57:22 +0000 |
| Subject: | Smarty - an observation | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-72@lists.php.net to get a copy of this message | ||
looking at the list there seems to be be discussion going on concerning the
performance of Smarty relative to other templating engines. i expected, like
others, that given the design of Smarty it would be at least on par with the
fastest solutions.
one observation i made, though, on cursory examination of the code, is
that the "compiler" code gets dragged in whether or not changes have been
made to the template files. i suspect that when a site goes into production,
templates would rarely change, if ever, so this seems to be unnecessary
overhead.
my thought, and suggestion, is that Smarty be slighly rewritten so that
the compile code gets "require_once'd" only after a check is made to see if
the template needs recompilation (again a rare occurrence in production
environments). Perhaps the Smarty class can use an inner SmartyCompiler
class that gets demand loaded if templates need refreshing (the loading can
be done after the template file is assigned). Compiler code in the current
methods of Smarty would then be stubs calling the appropriate methods of
SmartyCompiler.
just a thought. i have a few more ideas on extensions to the template
language which i'll share as i flesh them out further...