Re: [SMARTY-DEV] Re: speed improvement idea: path caching
| From: | Jason Sweat | Date: | Sat, 21 Jun 2003 12:59:55 +0000 |
| Subject: | Re: [SMARTY-DEV] Re: speed improvement idea: path caching | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1659@lists.php.net to get a copy of this message | ||
This thread reminds me somewhat of the "inline" coding thread that came
up earlier. That thread seem to go down the path of trying to take the
modifiers and migrate them into the code where each was called, similar
to a C inline.
Would it not make more sense (and eliminate some of this path issue?) to
take the _contents_ of the plugin function and append it to the compiled
template? (once per template per plugin) A reference to the plugin
function would then be locally defined in the compiled template script.
This would mean you would have to recompile templates if you want to
change the behavior of a plugin, but it should eliminate many includes,
one for each plugin used in a template.
Reasonable?
Jason
----- Original Message -----
From: "boots" <jayboots@yahoo.com>
To: "Smarty Dev" <smarty-dev@lists.php.net>
Sent: Saturday, June 21, 2003 4:51 AM
Subject: Re: [SMARTY-DEV] Re: speed improvement idea: path caching
> > > Isn't it possible (and simple) to cache paths
> > > (or use them directly) right in the compiled templates?
> > > I.e. modify $this->_load_plugins() and $this->_smarty_include()
> > > to work with full paths. This way path calculations are needed
> > > only at compile time, and no additional caches needed.
> >
> > hmm... boots just proposed this, too... I think that's a very good
> > idea, and it offers the best performance, as there's no need to
> > include another file.
>
> That's the point in favour of embedding--and its a good one.
>
> In favour of a separate file: if nothing in the template invalidates a
> path already cached (the likely scenario, at least for maturing
sites),
> then recompiles can use the existing path cache for the template
> thereby elminating the need to do path lookups at all in recompiles.
> (For cases that you really need to rebuild the path cache I suggested
a
> parameter switch to force them to be rebuilt.)
>
> I would almost favour the compile-time speed-up in this case since
> saving the single include is likely not going to have too great of a
> runtime performance boost, at least on systems that are accelerating
> PHP includes.
>
> Also in favour of a separate file is that it makes it more hackable :)
> you can change the runtime behaviour of a compiled template by
fiddling
> with the path cache file! ...also, you can load all of the individual
> path cache files for a site and do some interesting metrics on usage.
> At anyrate, it can lead to some interesting experiments.
>
> Just some thoughts.
> xo boots
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>