Quote:
Originally Posted by Varius
I'll agree with you on some other points, like if building a software for sale, many people don't know/use Smarty so it's not a wise choice. I also agree, to my knowledge there are no currently Top 100 sites using it. That doesn't mean much though as I have seen the code of two Top 100 Alexa sites myself and Smarty would definitely be an improvement over the mess they currently have and call 'code'
However on it using WAY more resources I must disagree, once it's been accessed it is compiled and like including any other PHP file. It's actually pretty lightweight as far as template systems go as the majority of load is in the plugins enabled/disabled. While it's caching is not something I'm a fan of, I've seen case studies where people got almost identical results in case studies of large (simulated) load on with Smarty vs. straight PHP.
Also, when you talk about such high load sites, *almost* always their issues stem from poor database query/database structure. I would be quite surprised if an otherwise perfect site suffered in performance due to using Smarty.
In the past, we have also experienced with multiple designers (in-house) that they were able to work with Smarty templates much easier than with standard PHP code. However, in such a situation we taught them the basics of Smarty and attempted to use only a limited amount of Smary functions in the templates to not overwhelm them.
|
It is impossible for an additional layer of abstraction to reach the performance of a system sans that layer unless additional technologies are employed within that layer which boost performance... In this case, the caching. However,
nothing beats Fast-CGI PHP via nginx with XCache.
Smarty definitely uses way more resources... Rather than processing inline it has to load a framework which will in turn load all templates into memory and each template has to be parsed... that's a major use of cycles right there...
I 100% agree with you on high load sites having DB bottlenecks... and Smarty IS lightweight when compared to other templating languages however, PHP IS a templating language... Why use a templating language within a templating language? The only logical answer to that is if you prefer the syntax of the inner templating language (in this case Smarty)... However, you must then admit that you are then making your development decisions based on personal preference rather than performance and accessibility/readability for others...