Re: [SMARTY-DEV] Inlining plugins/modifiers
| From: | Monte Ohrt | Date: | Thu, 22 May 2003 15:41:27 +0000 |
| Subject: | Re: [SMARTY-DEV] Inlining plugins/modifiers | ||
| References: | 1 2 3 4 5 6 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1491@lists.php.net to get a copy of this message | ||
On Thu, 2003-05-22 at 10:24, Wom.bat wrote:
> > Wom.Bat wrote:
> >
> > >>What will be done once? Done once per what? I mean, if the modifier is
> > >>only included once per invocation of the template (as opposed to once
> > >>per compilation of the template) that makes a *huge* difference for us
> > >>because we're having more than 1,5 milj. pageviews/day.
> > >
> > >
> > > plugins are included via include_once(). this means, regardless of how
> often
> > > you use the plugin, it is included ONCE per execution. and the overhead
> is
> > > near to zero, as PHP assembles the complete script before executing it.
> >
> > This "assembling" that is done by PHP, includes opening a file, right?
> > This can be safed if Smarty would inline the used modifiers in the
> > compiled template. It's an opportunity for Smarty to optimize, IMHO.
>
> the difference between inline code and code sitting in an external file
> is ONLY opening the file, reading it, and closing it... not more...
There is a difference... the code gets duplicated instead of reused, and
the file sizes grow larger. So which is going to be better? The presence
of an accelerator and disk/memory space is going to play a factor.
Monte