Smarty benchmark, anyone?

前端 未结 10 1988
旧时难觅i
旧时难觅i 2021-01-05 05:05

I am considering Smarty as my web app templating solution, and I am now concerned with its performance against plain PHP.

The Smarty site says it should be the same

10条回答
  •  無奈伤痛
    2021-01-05 05:18

    here's another templating solution XSLT here are my benchmarks for one of the pages i converted (its a simple page):

    // with smarty (baseline)
        0.014 seconds
    
    // with xsl/xslt-clientside
        0.008 seconds
        42% decrease in server stress
    
    // with xsl/xslt-serverside
    // this process would only be done if the users browser doesn't support client-side XSLT
        0.016 seconds
        14% increase in server stress
    

    Its not for everyone but if performance is your main concern :)

    On top of that you allow the client to cache your template.

    here's an example of what I'm doing (this is one of my sites): http://pixao.com

    and here's another example of it on a larger scale site: http://worldofwarcraft.com

    so far i have yet to run into any show stoppers

提交回复
热议问题