|
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 |
Malario Smarty n00b
Joined: 22 Aug 2003 Posts: 2
|
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Aug 22, 2003 1:58 pm Post subject: |
|
|
i think it's the opposite: with a "really small request" loading 2.5 klines of Smarty.class.php is significant overhead. but with a "really big request" (whatever that may be) the overhead is relatively small.
SCNR. |
|
Back to top |
|
Malario Smarty n00b
Joined: 22 Aug 2003 Posts: 2
|
Posted: Fri Aug 22, 2003 2:37 pm Post subject: ok |
|
|
I guess i didnt focused very well... If you have many request on a page, and this page have its content changing frequently, Will the Smarty Engine recreate the PhP file from the Tpl ? I think it must be too slow... cauze As i Said before, PHP is a interpreter language, and Smarty Do a interpretation of The TPL file... and creates other PHP files, that will be interpreted, And The worst... Its code is inside an object... So How Slow it will be if The Tpl is big, The Data is Big... etc
Can You see What I mean? ... I´m a bit worried... If I start to use this templates, and my project starts to get big, I would be very sad if I had to change all my code back.
Last edited by Malario on Wed May 05, 2010 11:00 pm; edited 1 time in total |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Aug 22, 2003 3:14 pm Post subject: Re: ok |
|
|
Malario wrote: | I guess i didnt focused very well... If you have many request on a page, and this page have its content changing frequently, Will the Smarty Engine recreate the PhP file from the Tpl ? |
no, the php-file is created (=compiled) only once from the tpl.
Quote: | I think it must be too slow... cauze As i Said before, PHP is a interpreter language, and Smarty Do a interpretation of The TPL file... and creates other PHP files, that will be interpreted |
"slow compared to what?" is the big question to me.
the tpl-files are only parsed once. parsing of the php-files can be speeded up by a source-code-cache like php-accelerator or turck-mm-cache. the database-load can be reduced immensly by smarty's caching of template-content that does not change on each re-display of the page.
Quote: | And The worst... Its code is inside an object... |
wrong, there is no difference in if the code is inside a function or a method.
Quote: | So How Slow it will be if The Tpl is big, The Data is Big... etc |
again: slow compared to what?
Quote: | Can You see What I mean? ... I´m a bit worried... If I start to use this templates, and my project starts to get big, I would be very sad if I had to change all my code back. |
smarty has some features to enhance speed, but it can never be faster than php because it's fully written in php. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Aug 22, 2003 3:42 pm Post subject: Re: ok |
|
|
messju wrote: | smarty has some features to enhance speed, but it can never be faster than php because it's fully written in php. |
Well, it can be faster than a lot of PHP only projects that don't have caching or resort to a lot of evals / preg_replaces at runtime to produce custom output texts as opposed to Smarty's one-time compile and built-in caching.
@Malario: its worth it. If you don't take our words for it, then test it yourself |
|
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
|