Question about smarty performance when using {include}
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
Question about smarty performance when using {include}
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?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Question about smarty performance when using {include}
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
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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/