Re: template engine...why???
| From: | rush | Date: | Wed, 30 Apr 2003 16:01:59 +0000 |
| Subject: | Re: template engine...why??? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145807@lists.php.net to get a copy of this message | ||
"Rasmus Lerdorf" <rasmus@lerdorf.com> wrote in message
news:Pine.WNT.4.53.0304300801440.728@DELL...
> The only templating systems I can honestly say are complementary are the
> ones that pre-generate pages so there is absolutely no run-time hit from
> the templating system. Anything that parses template files and by
> whatever means does search and replace stuff at runtime is just inherently
> nasty if you care about performance at all.
Honestly, while TT does generate code (which still uses str_replace), I
believe what you are saying is concetrating on optimizing a wrong spot of
code. Also statement that compiling into PHP is automatically so much faster
than string replace is also questionable. PHP is not executed on the bare
metal, but interpreted, and something is parsing that php code, or at least
swifting through the intermediate representation generated by the php
optimizer.
My experience is that real bottlenecks are elsewhere, and they are usually
order of magnitude larger. Some of them can be avoided by rearanging how the
application works , some by brute force, and some can not be avoided since
they are inherent to web application model.
I have been using TT on reasonably sized sites (not the huge ones like
yahoo, dmoz or cnn, but not the peanuts either, something in 50-100k
pages/day range), and I have not found performance reasons to avoid
templates. If I were to produce a huge site, I believe I would be still
using the same approach, and concetrate on modeling the logic of
application, and seek how to reduce the number of times samething is done,
and how to divide the work between the machines.
rush
--
http://www.templatetamer.com/