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

How Fast Is Smarty?

 
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
Malario
Smarty n00b


Joined: 22 Aug 2003
Posts: 2

PostPosted: Fri Aug 22, 2003 12:44 pm    Post subject: How Fast Is Smarty? Reply with quote

Well, Since Smarty uses objects and Its Known that Php objetcs in PHP 4 are many times slower than its structured programming, That is slow too. I want know if using this templates, when i have a Big request from database, will affect the performance in a big way. Question Question

Last edited by Malario on Wed May 05, 2010 11:00 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
messju
Administrator


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

PostPosted: Fri Aug 22, 2003 1:58 pm    Post subject: Reply with quote

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


Joined: 22 Aug 2003
Posts: 2

PostPosted: Fri Aug 22, 2003 2:37 pm    Post subject: ok Reply with quote

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


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

PostPosted: Fri Aug 22, 2003 3:14 pm    Post subject: Re: ok Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


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

PostPosted: Fri Aug 22, 2003 3:42 pm    Post subject: Re: ok Reply with quote

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 Wink
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