[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    [SMARTY-DEV] preliminary benchmark
From:       Monte Ohrt <monte () ispi ! net>
Date:       2003-06-20 16:38:14
[Download RAW message or body]

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


-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic