Re: speed considerations

From: Date: Fri, 28 Sep 2001 08:07:29 +0000
Subject: Re: speed considerations
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1570@lists.php.net to get a copy of this message
Roko Roic wrote: > >Smarty is split into two classes, Smarty and Smarty_Compiler. The latter > >one does not even get loaded if there is no need to compile templates. > > Thanks for the infoabout the smarty_compiler. > But I suppose that all of the smarty functionality (including the annoying > overlib code) does get loaded and that should be a big hit on load time. > > Too bad :( It's really easy to remove the "annoying" code if you want to. It is an addon, and even the built-in functions can be removed if you don't use them. Big hit on load time?? What is load time? The total time from a click in the browser to a finished page is so unpredictable, and depends on so much more than the script, so I must assume this is NOT what you mean. The time it takes to load and compile the script? Perhaps you should consider removing all the comments from the scripts, since they are also very bulky. Remove white space and all line breaks, they are purely cosmetic too.... Finally, rename all functions and variables to a maximum of two characters. This way, your script will be short and load fast. Aaaahh, I'm only joking!!! ;-) But seriously.... If a millisecond here and there matters so much, you must be running a *really* high volume site, and in that case - why are you hosted by El Crappo Inc?? You should go dedicated, optimize your server, fine tune your scripts, install PHP caching software and use gzip encoding of your pages. Smarty might be somewhat slower the first time you display a page. But after that... Simpler template engines have to be loaded and compiled, just like Smarty. They still parse the template every time (eeeew!), or do some crappo string replacement. Smarty, OTOH, will execute a precompiled template. All the hard work is already done. /Anders

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