Re: Reduce execution time in loops

From: Date: Tue, 04 Dec 2001 22:25:10 +0000
Subject: Re: Reduce execution time in loops
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2129@lists.php.net to get a copy of this message
On Tue, 04 Dec 2001, Victor Boivie wrote: > I have a sort of report generation script with many {section}s to > render all the data I want to show. Speed is very important to me, so > I've tried to optimize my code as much as I can. > > I don't need the nice variables as "iteration", "rownum", > "index_prev" > etc in my code. I hardly need them at all even in my most advanced > scripts! So I tried to remove the lines for them from my already > compiled tpl-file, and guess what happened? The time it takes for PHP > to render the file (not running my code.. just the template) decreased > from 302 -> 166 ms. That's a quite good speed gain, don't you think? Which lines did you remove exactly? > So I would like to add the ability to disable Smarty from adding these > not-so-important lines in my case. Section is just one example, and I > think there should be quite many speed optimizations. The new versions > of Smarty has only become full of special functions that we rarely > use. I think it would be better to focus on the common things and try > to make them better. A slow and bloated template engine won't make > anyone happy. Frankly, I have not heard anyone call Smarty slow, up to this point, I guess. We always try to keep speed in mind, but it is difficult to satisfy both those who crave features and those who want speed. > I don't mind if the compilation time will be ten times higher: I > almost never compile the files. (once per day at max). Thanks for feedback. -Andrei * Apples have always been a problem ever since Eden. *

« previous php.smarty.general (#2129) next »