Re: [SMARTY] upcoming benchmarks
| From: | Monte Ohrt | Date: | Thu, 06 Jun 2002 00:38:43 +0000 |
| Subject: | Re: [SMARTY] upcoming benchmarks | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4640@lists.php.net to get a copy of this message | ||
This is smarty with no cache, and it is benchmarking the raw speed of the template execution, not the load time. The original tests (currently posted on the Smarty site) are with the loading/parsing of the scripts accelerated and non-accelerated using apache bench. php-accelerator makes a huge difference in this case, especially with Smarty since it was designed to take full advantage of one. An accelerator basically removes the overhead of loading the PHP files. If you're not using an accelerator and speed is of the essence (?), then Smarty probably won't be your optimal solution. I really don't see a reason why you wouldn't use an accelerator with PHP, it only helps every script you have and brings the system load down tremendously.
I'll work a bit more with the benchmarks and see if I can figure in the parsing/loading times. I'd be more than happy to work with each template engine author to be sure I'm doing things right.
Monte
Brian E. Lozier wrote:
Is this smarty with no cache? And don't you think you should include the loading/parsing of the class in the test as well? In my sites, the actual LOADING of the class was the problem (loading a 1700-line php file for every page hit), not the speed of the looping or assigning variables. I hate skewed benchmarks, and placing whether the cache is on or off and including the length of time it takes to load the template class itself is important. Brian 6/5/02 2:35:48 PM, Monte Ohrt <monte@ispi.net> wrote:I've finished the very first test. I assign and parse 50 template variables. I ran each engine 100 times in a row. I tried my best to figure out how to setup each one the most efficiently (assigning vars, etc.) I'll be uploading all the sources so you can let me know if my routines need adjustment. I have no idea why UltraTemplate is so slow at this one. As for ModeliXe, it has a built-in caching system that I don't know how to disable, so I left it on and gave it a directory to dump cache files to. Smarty still outpaces it though (no caching) Here is a snapshot of the test run. Each reload was basically identical, so this is pretty accurate. http://www.phpinsider.com/bm.gif This is running under php-accelerator, although I don't think it has much of a bearing because I load all the PHP class files in one lump before going through the tests. Next will be a block loop test. This will take a bit longer to figure out in each engine. :-) Monte Bertrand DUNOGIER wrote:-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc. -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpPB> Except of course that it may beat Smarty :-) And then ? Most template engines are probably faster than smarty, since they have less features. Smarty is a particular template solution, being the only one to compile templates, and being so customizable. And even if a solution might be better, it is good to include it in benchmarks since it shows where developpement might be oriented to improve the product. And never forget that smarty is not only a html output class... in my opinion, it also allows a better code, much closer to prof. real applications in "coding standards" terms. Oh, and a benchmark is not only a way to say "this is the fastest solution, forget about the others" :) BertrandYou could add ModeliXe, seems like it is a very serious engine (http://modelixe.phpedit.com)