Re: [SMARTY] Smarty-Light

From: Date: Thu, 15 Jul 2004 10:20:28 +0000
Subject: Re: [SMARTY] Smarty-Light
References: 1 2 3 4 5 6 7 8  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11601@lists.php.net to get a copy of this message
On Jul 15, 2004, at 3:24 AM, Markku Niskanen wrote:
All this makes me wonder where the speed difference really comes from. Unused features only affect the class loading time and if a kept feature (a loop, for instance) is used the same way it should take the same CPU cycles to run.
Loading of the class is a significant difference, however, that's not all there is to it. If I don't use pre/post/output filters, I don't have to check for them and I don't have to run them. If I don't use resources, I don't have to see if they're there. If I don't use security, then I don't have to check for it. If I don't support classes and objects, then my regular expressions don't have to work as hard. Etc. The features I took out are things that I felt were frivolous and not needed for my purposes and the purpose of the average template engine user.
If the 'section' code, for instance is in the class but I do not use it it should only use CPU when parsing/compiling the class. If there is very little other optimization a 'light' version should not be significantly faster after loading the class. Am I missing something?
You are missing and not realizing just how slow PHP is at loading and compiling classes and associated code. Remember, without an accelerator, PHP recompiles each script every time it is invoked. The more code there is, the more there is to compile and the longer it will take the script to actually start. Not to mention I did do a lot of optimization to the original Smarty code.
Markku


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