Re: [SMARTY] Smarty-Light
| From: | Paul Lockaby | Date: | Wed, 14 Jul 2004 00:59:20 +0000 |
| Subject: | Re: [SMARTY] Smarty-Light | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11584@lists.php.net to get a copy of this message | ||
Alright, it's been a while since I've researched optimizing things, and a few years ago it did cost money to get an accelerator that was any good. So you win on the cost argument.
However, running your own CGI is a horrible security risk, and not to mention inefficient (probably removing any effect the accelerator would have in the first place). However, I do believe the point is being missed. I think that one shouldn't feel that one can write sloppy or large code simply because there are fast CPUs or simply because one is using an accelerator. One should always strive to write compact, fast, and efficient code. That is what I tried to do with Smarty by creating Smarty-Light.
The whole point of me emailing this list, however, was not for the above flame. Some of you may remember me from back in late 2002 and early 2003. I used to use Smarty and I even submitted some patches -- my name appears in the changelog a couple times. However, the reason I forked Smarty to create Smarty-Light was because I didn't like some of the syntax issues (backticks for concatenation? why not use the PHP and Perl method of putting a dot between strings?) and because Smarty was, and still is, in my opinion, bloated and slow. That's why I forked it. And I wrote it with speed in mind, doing benchmarks with every major change. Code size definitely makes a difference with speed and PHP objects are really slow.
However, the point of my emailing this list was to point out that small file sizes and compact code and removing features that you don't use really does make a difference in speed -- more than twice as fast in the examples I provided. That was the point of this email. Sorry to bother all of you, and Monte/Messju, you guys really do maintain a good piece of software here, otherwise I wouldn't have forked it and instead would have forked one of the other bazillion template engines available for PHP. But a speed demon it is not.
Paul Lockaby
On Jul 12, 2004, at 6:27 AM, Stefan wrote:
You're neither need root access, nor not a cent. mmcache i.e. is licensed under the gnu gpl. So can be used without any fee. Using it on a safe-mode php version is also possible, if you may execute CGIs as well. You bypass the systems php Version using your own, if you run your scripts as cgi. Using this approach you can specify your own php.ini, can activate, or deactivate safe-mode und finally can load extensions. Drawback could be, that your Scripts have to get a different suffix (ugly). Perhaps .php4.cgi . or .cgi, or whatever your provider has set up. And ... you have to compile php in fcgi mode (most versions of php, are compiled for cli mode) and perhaps to link it static against the used libraries. Because of that the executable could become quiet big (~10 meg). Using -Os (optimization for size) reduces the size to nearly ~1.0 meg. ... Some technical gimmicks, but it's not a question of money ... .