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

Speed 2.x vs 3.x

 
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
cyber
Smarty Regular


Joined: 08 Jun 2006
Posts: 51

PostPosted: Thu Jul 16, 2015 7:10 am    Post subject: Speed 2.x vs 3.x Reply with quote

Purely out of interest, I wondered if tests have been done by somebody, to find out how much slower or faster Smarty 3.x is vs. 2.x ?

PS. what is the consensus these days wrt speed of 3.x ?
Is it considered faster or slower than 2.x versions, or neither ?

Just wondering, no biggie.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Jul 16, 2015 12:31 pm    Post subject: Reply with quote

It is considered irrelevant.
Back to top
View user's profile Send private message
cyber
Smarty Regular


Joined: 08 Jun 2006
Posts: 51

PostPosted: Thu Jul 16, 2015 12:41 pm    Post subject: Reply with quote

Oh but it is relevant !!

If 3.x is considerably slower, or faster than 2.x, then it is relevant !

Unless you mean to say that there are no considerable changes that would affect speed too much (e.g. disk IO) and hence speed differences are unmeasurable or just academic in the big scheme of things.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Jul 16, 2015 10:52 pm    Post subject: Reply with quote

You gain time in rapid development and deployment.
You're not serving 3-4k users a minute, are you?
Back to top
View user's profile Send private message
cyber
Smarty Regular


Joined: 08 Jun 2006
Posts: 51

PostPosted: Fri Jul 17, 2015 6:08 am    Post subject: Reply with quote

Same as previous post, you avoid giving a straight answer and go on to assume things you really don't know. I may or may not be serving 3-4K users per minute, I may be on super fast or super slow infrastructure etc. It still doesn't answer the question.

I shall interpret this as '3.x is slower but it only becomes relevant when you serve 3-4K users per minute on current-standard infrastructure'

Subject closed, thanks.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat Jul 18, 2015 12:22 am    Post subject: Reply with quote

The speed is dependent on features you use. Overall, it isn't any slower, than PHP itself can output data, assuming you are using caching.
There's just no "straight answer". You can only answer it for yourself in your own environment for your own use case.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Jul 25, 2015 7:41 pm    Post subject: Reply with quote

There is no general answer.
Smarty 3 is object oriented, has much more features and a larger code base.
Basically it's a bit slower than Smarty 2.

But if you have {include} inside loops Smarty 3 is much faster. Just one example.

Also Smarty 3 has some features for optimizations.
For example you can set the $smarty->merge_compiled_include option which will merge the code of all subtemplates into the compiled template of the main page. This will save the reads for all compiled subtemplate when rendering. This is a huge performance boost when you have a larger number of subtemplates.

These are just some examples.
Back to top
View user's profile Send private message
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