preliminary benchmark

From: Date: Fri, 20 Jun 2003 16:38:14 +0000
Subject: preliminary benchmark
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1631@lists.php.net to get a copy of this message
Hi, I have an interesting benchmark result I thought I'd share. This is comparing Smarty 2.5.0 to the current CVS (with the abstracted core.) The idea behind the abstraction was to increase the runtime speed while only slightly affecting the compiling speed. The results for non-accelerated tests are quite a big difference! I did a vanilla compile of Apache 1.3.27 and PHP 4.3.2. I benchmarked with and without the PHPA accelerator. This test is just a single template with "hello world" as the text. First, I enabled force_compile to benchmark the compilation stage. hello world, force_compile=true: 2.5.0 with PHPA: 33.20 req/sec, or 30.12ms CVS with PHPA: 33.13 req/sec, or 30.18ms difference: -0.211% 2.5.0 without PHPA: 8.92 req/sec, or 112.13ms CVS without PHPA: 8.80 req/sec, or 113.57.18ms difference: -1.345% So in both cases, the compiling stage is only slightly slower. Now with compile_check=false to test the runtime speeds: hello world, compile_check=false: 2.5.0 with PHPA: 174.55 req/sec, or 5.73ms CVS with PHPA: 176.52 req/sec, or 5.67ms difference: +1.116% 2.5.0 without PHPA: 19.47 req/sec, or 51.36ms CVS without PHPA: 31.92 req/sec, or 31.33ms difference: +39.004% As you can see, the runtime speed gained slightly over 2.5.0 with PHPA (1.116%), and is WAY faster than 2.5.0 without PHPA (39.004% !!!). This is due to the core abstraction, relinquishing the class instantiation overhead. So for those of you without accelerators, this version is going to make a big impact on your performance! I'll be doing some more benchmarks with a more true-to-life template file with variables, functions, etc. But, I thought I'd share this info with the group. I think I can squeeze a little more compile-time abstraction from the class file too... Monte

« previous php.smarty.dev (#1631) next »