View previous topic :: View next topic |
Author |
Message |
pt2002 Smarty Regular
Joined: 05 May 2003 Posts: 89 Location: Porto, Portugal
|
Posted: Mon Aug 11, 2003 6:01 pm Post subject: Benchmarks with cache=false and cache=true |
|
|
Hi
doing some tests with apache ab i'm getting an average of 5 requests per second more with cache=false than with cache=true.
I'm doing this tests in localhost, apache 1.3.28, php 4.3.2, smarty 2.60 rc1
I think it should have more requests with cache=true.
Why?
Greetings |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Aug 11, 2003 6:42 pm Post subject: |
|
|
Interesting. Out of curiousity, are you using PHP as a module or CGI? Also, what are you testing? By chance does your cached content contain {insert}s ?
Last edited by boots on Mon Aug 11, 2003 9:34 pm; edited 2 times in total |
|
Back to top |
|
pt2002 Smarty Regular
Joined: 05 May 2003 Posts: 89 Location: Porto, Portugal
|
Posted: Mon Aug 11, 2003 6:57 pm Post subject: |
|
|
Hi
using php as an Apache module and no {insert}'s.
Just 5 simple tpl files: header, left, center, right & footer. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Aug 11, 2003 7:15 pm Post subject: |
|
|
Try setting compile_check to false, otherwise the compile tests will always happen irregardless of the caching. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Aug 11, 2003 8:07 pm Post subject: |
|
|
@pt2002: are you testing a rather simple page, like the "Hello Ned" from the demo?
i am not suprised if this is actually slower with caching enabled: it's an extra layer that is added and there is only a little percentage of the overall time can be accelerated (the percentage that the display()-call took, which is rather small).
caching only makes sense if you have bigger pages with more complicated display-logic. it really shines if you also can omit a lot of business-logic in your php-scripts with $smarty->is_cached(). synthetic tests like "Hello Ned" are naturally slower with caching enabled no matter if you bench 2.5.0 or 2.6.0-RC1. |
|
Back to top |
|
pt2002 Smarty Regular
Joined: 05 May 2003 Posts: 89 Location: Porto, Portugal
|
Posted: Mon Aug 11, 2003 9:28 pm Post subject: |
|
|
Hi
it's not a simple template like 'Hello, Ned'.
You can see the non-smarty version of the site at http://www.bandasfilarmonicas.com
Top, left and right are static. Center content come from a database.
I will try in a few minutes compile_check = false to see the results.
Thank you very much for your quick answers. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Aug 11, 2003 10:22 pm Post subject: |
|
|
pt2002 wrote: | it's not a simple template like 'Hello, Ned'.
|
hmm, then your numbers are a bit odd. a test-page from our inhouse-cms with a few foreach-loops and a lot of modifiers takes ~350ms on a P166. with caching enabled this boils down to ~130ms. if i additionally put "if (!$smarty->is_cached($tpl)) ..." around the data-gathering and assinging (everything unneeded once the page was cached) the same page takes ~34ms constantly. |
|
Back to top |
|
|