Permalink
Browse files

move faster engine higher order

  • Loading branch information...
ben-lin committed Jul 9, 2012
1 parent e8bbe0e commit 0e19c1e5cfa987075c7e3b169583164472acca5f
Showing with 56 additions and 56 deletions.
  1. +56 −56 benchmarks/run.js
View
@@ -72,6 +72,24 @@ var thunder_tpl_escape = fs.readFileSync( './templates/thunder_escape.html', 'ut
var compiled = {};
var engines = [
+ {
+ name : 'thunder',
+ key :'thunder',
+ tpl : thunder_tpl,
+ tpl_escape : thunder_tpl_escape,
+ compile : function (){
+ return thunder.cached( this.tpl );
+ },
+ compile_escape : function (){
+ return thunder.cached( this.tpl_escape );
+ },
+ render : function ( locals ){
+ return compiled.thunder( locals );
+ },
+ render_escape : function ( locals ){
+ return compiled.thunder_escape( locals );
+ }
+ },
{
name : 'doT',
key : 'dot',
@@ -90,6 +108,42 @@ var engines = [
return compiled.dot_escape( locals );
}
},
+ {
+ name : 'jst',
+ key : 'jst',
+ tpl : jst_tpl,
+ tpl_escape : jst_tpl_escape,
+ compile : function (){
+ return jst.compile( this.tpl );
+ },
+ compile_escape : function (){
+ return jst.compile( this.tpl_escape );
+ },
+ render : function ( locals ){
+ return compiled.jst( locals );
+ },
+ render_escape : function ( locals ){
+ return compiled.jst_escape( locals );
+ }
+ },
+ {
+ name : 'nTenjin',
+ key : 'tenjin',
+ tpl : tenjin_tpl,
+ tpl_escape : tenjin_tpl_escape,
+ compile : function (){
+ return tenjin.compile( this.tpl );
+ },
+ compile_escape : function (){
+ return tenjin.compile( this.tpl_escape );
+ },
+ render : function ( locals ){
+ return compiled.tenjin( locals );
+ },
+ render_escape : function ( locals ){
+ return compiled.tenjin_escape( locals );
+ }
+ },
{
name : 'EJS',
key : 'ejs',
@@ -200,24 +254,6 @@ var engines = [
return jqtpl.tmpl( compiled.jqtpl_escape, locals );
}
},
- {
- name : 'jst',
- key : 'jst',
- tpl : jst_tpl,
- tpl_escape : jst_tpl_escape,
- compile : function (){
- return jst.compile( this.tpl );
- },
- compile_escape : function (){
- return jst.compile( this.tpl_escape );
- },
- render : function ( locals ){
- return compiled.jst( locals );
- },
- render_escape : function ( locals ){
- return compiled.jst_escape( locals );
- }
- },
{
name : 'Swig',
key : 'swig',
@@ -235,42 +271,6 @@ var engines = [
render_escape : function ( locals ){
return compiled.swig_escape( locals );
}
- },
- {
- name : 'nTenjin',
- key : 'tenjin',
- tpl : tenjin_tpl,
- tpl_escape : tenjin_tpl_escape,
- compile : function (){
- return tenjin.compile( this.tpl );
- },
- compile_escape : function (){
- return tenjin.compile( this.tpl_escape );
- },
- render : function ( locals ){
- return compiled.tenjin( locals );
- },
- render_escape : function ( locals ){
- return compiled.tenjin_escape( locals );
- }
- },
- {
- name : 'thunder',
- key :'thunder',
- tpl : thunder_tpl,
- tpl_escape : thunder_tpl_escape,
- compile : function (){
- return thunder.cached( this.tpl );
- },
- compile_escape : function (){
- return thunder.cached( this.tpl_escape );
- },
- render : function ( locals ){
- return compiled.thunder( locals );
- },
- render_escape : function ( locals ){
- return compiled.thunder_escape( locals );
- }
}
];
@@ -335,8 +335,8 @@ var render_speed = function ( engines, method, shared_vars, count, title ){
jst.configure({ useIt : true });
swig.init({
- allowErrors: false,
- autoescape: false
+ allowErrors : false,
+ autoescape : false
});

0 comments on commit 0e19c1e

Please sign in to comment.