Re: [SMARTY-DEV] Re: speed improvement idea: path caching

From: Date: Sat, 21 Jun 2003 09:51:35 +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-1650@lists.php.net to get a copy of this message
> > 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

« previous php.smarty.dev (#1650) next »