|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
iriePub Smarty Regular
Joined: 16 Jun 2006 Posts: 53
|
Posted: Tue Aug 15, 2006 12:47 pm Post subject: Performance of Assigned Var's |
|
|
Hi,
is smarty getting slower when I assign much variables, or doesn't it matter?
I don't know, how smarty really works.
If it works like this (pseudocode):
Code: |
foreach($assigned_vars $varname=>$value) {
$content = str_replace($ldelim . '$' . $varname . $rdelim, $value, $content);
}
|
it would getting much more slower. but if smarty first matches all Vars by using preg_match_all() it would not getting much slower, because only the really in template used var's would get replaced, and not all /like in the 1. example).
I hope you understand me ...
thanks!! |
|
Back to top |
|
shannera Administrator
Joined: 13 Feb 2006 Posts: 802 Location: Edertal, Germany
|
Posted: Tue Aug 15, 2006 1:41 pm Post subject: |
|
|
Why not look at the source code for yourself and do a little analysis. e.g. in the compiler class? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Aug 15, 2006 1:41 pm Post subject: |
|
|
No it doesn't get slower with more assigned vars. Variables are compiled once from {$foo} to something like <?=$this->_tpl_vars['foo']?>, and then executed as plain php from that point forward. |
|
Back to top |
|
iriePub Smarty Regular
Joined: 16 Jun 2006 Posts: 53
|
Posted: Tue Aug 15, 2006 2:09 pm Post subject: |
|
|
mohrt wrote: | No it doesn't get slower with more assigned vars. Variables are compiled once from {$foo} to something like <?=$this->_tpl_vars['foo']?>, and then executed as plain php from that point forward. |
great answer, thanks! |
|
Back to top |
|
iriePub Smarty Regular
Joined: 16 Jun 2006 Posts: 53
|
Posted: Wed Aug 16, 2006 3:49 pm Post subject: |
|
|
which settings can improve the performance of smarty EXCEPT caching?
I disabled force_compile, check_compile, what else can I do? thanks!! |
|
Back to top |
|
|
|
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
|