Re: [SMARTY] Smarty Light

From: Date: Fri, 09 Jul 2004 10:37:05 +0000
Subject: Re: [SMARTY] Smarty Light
References: 1 2 3 4 5  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11552@lists.php.net to get a copy of this message
On Thu, 08 Jul 2004 11:09:06 -0700, you wrote: >of its heft by taking a few of the less used features out. Now >if you use an accelerator this probably won't make any difference, I just reported my findings in the developer area. I removed all whitespace and comments from the Smarty.class.php using PHP5 function php_strip_whitespace() and the results using my Linux/Celeron 300 was this (rough test averages, just loading the Smarty.class.php file): Original Smarty.class.php 0.0453 seconds Stripped Smarty.class.php 0.0388 seconds. The difference was around 0,0065 seconds. This way you gain something ina non-accelerated environment without doing any changes in code. In an opcode-cached environment there is no difference, of course. The stripped class was around 30 K as opposed to the 60 K of the original file and the time difference comes from the parsing phase. After that the CPU time your application uses will very probably depend on the nature of your code, what features you are using. If you use simple assigns followed by a single "display" there will be no further benefit from a stipped-down version as the code will be identical, anyhow. As most other writers I do not believe in any benefit that would come from a 'light' version of Smarty. The more one uses it the more features one will make use of. I know many users do not like the "section" loops but I use them extensively as they provide much more flexibility. It just takes some time to understand where the clue is. The same is true about many other features: once you use a feature you cannot live without it :) Markku

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