Re: [SMARTY] Slow performance checking smarty->is_cached
| From: | Monte Ohrt | Date: | Mon, 24 Feb 2003 15:17:05 +0000 |
| Subject: | Re: [SMARTY] Slow performance checking smarty->is_cached | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8151@lists.php.net to get a copy of this message | ||
Maybe the problem lies in _fetch_template_info? This would have to be
debugged with timers to figure out exactly where the time is being
taken.
I committed a patch that uses a tmp file for file writes. If your
problem has anything to do with lock retention, this might help.
Monte
On Sun, 2003-02-23 at 17:39, Jason Donald wrote:
> Hi,
>
> Experiencing lockups or slow behavior during smarty->is_cached
> checks. From 0 to several seconds delay. Subsequent is_cached
> checks of the same template file are very quick (.01 seconds). Of 5
> templates checked per page, perhaps 2 or so will exhibit this delay.
> Happens every time if the server is stressed at all.
>
> Using Redhat 7/PHP4.3.0/Smarty 2.4.2/Apache 1.3.27.
>
> Problem is occuring around line 2300 in Smarty.class.php with this
> code:
>
> foreach ($this->_cache_info['template'] as $template_dep)
> {
> $this->_fetch_template_info($template_dep, $template_source, $template_timestamp, false);
> if ($this->_cache_info['timestamp'] < $template_timestamp)
> {
> // template file has changed, regenerate cache
> return false;
> }
> }
>
> It seems to be running around 200 iterations, taking its time with
> each. Is there some coding style or optimization that I can make to
> speed this code up?
>
> Thanks
>
> Jason.
--
Monte Ohrt <monte@ispi.net>