js模板引擎
2015-12-22 13:15
471 查看
最近做了JS模板引擎测试,拿各个JS模板引擎在不同浏览器上去运行同一程序,下面是模板引擎测试数据;通过测试artTemplate、juicer与doT引擎模板整体性能要有绝对优势;
100 条数据 × 10000 次渲染测试 [isEscape:false, isCache:true]
ie8浏览器(8.0.6001.18702)
chrome浏览器(版本 26.0.1410.64 m)
Apple safari浏览器(5.1.7(7534.57.2))
firefox浏览器(19.0.2)
奇虎360浏览器(版本号6.1.0.356,内核版本:21.0.1180.89)
通过对各模板引擎测试结果,可以看出
artTemplate,juicer与doT引擎模板整体性能要有绝对优势;
其中doT引擎模板在IE与safari浏览器表现非常优越;
tmpl模板引擎在IE中运行能完美胜出,但在其它浏览器中表现就差很多;
延伸
通过对模板引擎的熟知,不同浏览器渲染能力也不一样;渲染快的打开网页速度就快;chrome与360浏览器打开速是最快的;ie浏览器的速度是最慢;
artTemplate: https://github.com/aui/artTemplate
juicer: http://juicer.name/或https://github.com/PaulGuo/Juicer/zipball/master#download
doT:doT source:https://github.com/olado/doT Docs:http://olado.github.com/doT/
tmpl:https://github.com/BorisMoore/jquery-tmpl
handlebars:http://handlebarsjs.com/或https://raw.github.com/wycats/handlebars.js/1.0.0-rc.4/dist/handlebars.js
easyTemplate:https://github.com/qitupstudios/easyTemplate
underscoretemplate: http://documentcloud.github.io/underscore/
mustache:https://github.com/janl/mustache.js
kissytemplate:https://github.com/ktmud/kissy
相关引擎资料
浅析js模板引擎
js模板引擎
JavaScript 模板引擎作为数据与界面分离工作中最重要一环,越来越受开发者关注,从而出现在各大型网站 Twitter、淘宝网、新浪浪微博、腾讯QQ空间、腾讯微博等。那么他们各自性能怎么样?请看下面。通常模板引擎
baiduTemplate(百度)\artTemplate(腾讯)\juicer(淘宝)\doT\ tmpl\ handlebars\ easyTemplate\ underscoretemplate \ mustache \kissytemplate各模板测试数据
引擎渲染速度竞赛100 条数据 × 10000 次渲染测试 [isEscape:false, isCache:true]
ie8浏览器(8.0.6001.18702)
chrome浏览器(版本 26.0.1410.64 m)
Apple safari浏览器(5.1.7(7534.57.2))
firefox浏览器(19.0.2)
奇虎360浏览器(版本号6.1.0.356,内核版本:21.0.1180.89)
测试结果
通过对各模板引擎测试结果,可以看出
artTemplate,juicer与doT引擎模板整体性能要有绝对优势;
其中doT引擎模板在IE与safari浏览器表现非常优越;
tmpl模板引擎在IE中运行能完美胜出,但在其它浏览器中表现就差很多;
延伸
通过对模板引擎的熟知,不同浏览器渲染能力也不一样;渲染快的打开网页速度就快;chrome与360浏览器打开速是最快的;ie浏览器的速度是最慢;
各个模板引擎下载地址
baiduTemplate: http://baidufe.github.io/BaiduTemplate/artTemplate: https://github.com/aui/artTemplate
juicer: http://juicer.name/或https://github.com/PaulGuo/Juicer/zipball/master#download
doT:doT source:https://github.com/olado/doT Docs:http://olado.github.com/doT/
tmpl:https://github.com/BorisMoore/jquery-tmpl
handlebars:http://handlebarsjs.com/或https://raw.github.com/wycats/handlebars.js/1.0.0-rc.4/dist/handlebars.js
easyTemplate:https://github.com/qitupstudios/easyTemplate
underscoretemplate: http://documentcloud.github.io/underscore/
mustache:https://github.com/janl/mustache.js
kissytemplate:https://github.com/ktmud/kissy
相关引擎资料
浅析js模板引擎
高性能JavaScript模板引擎原理解析
在前端开发中应用JS模板引擎 -- 事半功倍!
相关文章推荐
- Jsoup-解析Html文档
- Javascript的ArrayBuffer从Utf8ArrayToString
- jsp中使用POST的方法在网页之间传递参数的简单方法
- js选项卡
- NSDictionary,JSON和XML互相转换
- JSP的include指令
- json时间转正常时间
- JS教程:String对象及其常用属性以及方法
- js知识总结
- JavaScript+CSS无限极分类效果完整实现方法
- js this指代详解与分享
- JS实现的表格操作类详解(添加,删除,排序,上移,下移)
- 百度JS模板引擎 baiduTemplate 1.0.6 版
- javascript 闭包的简单demo
- JSR 133
- 用js实现一个map对象
- JS控制按钮10秒钟后可用的方法
- JavaScript判断对象是否为数组
- JSON和JSONP的区别及使用方法
- a 标签中调用js的几种方法 文章摘自他人