View previous topic :: View next topic |
Author |
Message |
cyber Smarty Regular
Joined: 08 Jun 2006 Posts: 51
|
Posted: Thu Jul 16, 2015 7:10 am Post subject: Speed 2.x vs 3.x |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jul 16, 2015 12:31 pm Post subject: |
|
|
It is considered irrelevant. |
|
Back to top |
|
cyber Smarty Regular
Joined: 08 Jun 2006 Posts: 51
|
Posted: Thu Jul 16, 2015 12:41 pm Post subject: |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jul 16, 2015 10:52 pm Post subject: |
|
|
You gain time in rapid development and deployment.
You're not serving 3-4k users a minute, are you? |
|
Back to top |
|
cyber Smarty Regular
Joined: 08 Jun 2006 Posts: 51
|
Posted: Fri Jul 17, 2015 6:08 am Post subject: |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Jul 18, 2015 12:22 am Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Jul 25, 2015 7:41 pm Post subject: |
|
|
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 |
|
|