Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Benchmarks with cache=false and cache=true

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
pt2002
Smarty Regular


Joined: 05 May 2003
Posts: 89
Location: Porto, Portugal

PostPosted: Mon Aug 11, 2003 6:01 pm    Post subject: Benchmarks with cache=false and cache=true Reply with quote

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
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Aug 11, 2003 6:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
pt2002
Smarty Regular


Joined: 05 May 2003
Posts: 89
Location: Porto, Portugal

PostPosted: Mon Aug 11, 2003 6:57 pm    Post subject: Reply with quote

Hi

using php as an Apache module and no {insert}'s.

Just 5 simple tpl files: header, left, center, right & footer.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Aug 11, 2003 7:15 pm    Post subject: Reply with quote

Try setting compile_check to false, otherwise the compile tests will always happen irregardless of the caching.
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Aug 11, 2003 8:07 pm    Post subject: Reply with quote

@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
View user's profile Send private message Send e-mail Visit poster's website
pt2002
Smarty Regular


Joined: 05 May 2003
Posts: 89
Location: Porto, Portugal

PostPosted: Mon Aug 11, 2003 9:28 pm    Post subject: Reply with quote

Hi

it's not a simple template like 'Hello, Ned'. Very Happy
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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Aug 11, 2003 10:22 pm    Post subject: Reply with quote

pt2002 wrote:
it's not a simple template like 'Hello, Ned'. Very Happy


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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP