Page 1 of 1

Question about smarty performance when using {include}

Posted: Tue Sep 05, 2006 8:25 pm
by carl_galloway
Does anyone know if using the smarty {include} directive has any impact on performance? Specifically if index.tpl includes startpage.tpl, which then includes latestentry.tpl would this make serendipity slower?

Re: Question about smarty performance when using {include}

Posted: Wed Sep 06, 2006 8:25 am
by garvinhicking
Hi!

Basically every include that is done, hurts performance especially on systems without a PHP binary code cache. Putting the "hurt" into number is quite hard. It could be anything between 0.x and maybe 15% of impact. These are rough figures deduced from my personal include tests, your mileagle may vary.

Your guidline should be: Avoid custom includes if possible. But where necessary, don't feel terribly afraid to use it. A smarty includes nearly boils down to the same overhead of a PHP include; there is little overhead in what smarty does, since it also only includes compiled smarty templates.

Best regards,
Garvin