Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 159 lines (132 sloc) 2.69 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
== Underscore

var N = 50000;
var start_time = new Date().getTime();
var comment = {
      votes_count: 123,
      voted: true,
      content: 'test comment',
      uname: 'test',
      ulink: '/test',
      uimage: '',
      isHost: true,
      accepted: true,
      score: {}
    };
for (i=0;i<=N;i=i+1)
{
  templates_underscore(comment);
}

var finish_time = new Date().getTime();
console.log("underscore " + N);
console.log(N/(finish_time - start_time)*1000);

== doT

var N = 50000;
var start_time = new Date().getTime();
var comment = {
      votes_count: 123,
      voted: true,
      content: 'test comment',
      uname: 'test',
      ulink: '/test',
      uimage: '',
      isHost: true,
      accepted: true,
      score: {}
    };
for (i=0;i<=N;i=i+1)
{
  templates_doT(comment);
}

var finish_time = new Date().getTime();
console.log("doT " + N);
console.log(N/(finish_time - start_time)*1000);

== doT

var N = 50000;
var start_time = new Date().getTime();
var comment = {
      votes_count: 123,
      voted: true,
      content: 'test comment',
      uname: 'test',
      ulink: '/test',
      uimage: '',
      isHost: true,
      accepted: true,
      score: {}
    };
for (i=0;i<=N;i=i+1)
{
  templates_doT(comment);
}

var finish_time = new Date().getTime();
console.log("doT " + N);
console.log(N/(finish_time - start_time)*1000);

=== EJS

var N = 50000;
var start_time = new Date().getTime();
var comment = {
      votes_count: 123,
      voted: true,
      content: 'test comment',
      uname: 'test',
      ulink: '/test',
      uimage: '',
      isHost: true,
      accepted: true,
      score: {}
    };
for (i=0;i<=N;i=i+1)
{
  JST.ejs_template(comment);
}

var finish_time = new Date().getTime();
console.log("EJS " + N);
console.log(N/(finish_time - start_time)*1000);

=== SOY

var N = 50000;
var start_time = new Date().getTime();
var comment = {
      votes_count: 123,
      voted: true,
      content: 'test comment',
      uname: 'test',
      ulink: '/test',
      uimage: '',
      isHost: true,
      accepted: true,
      score: {}
    };
for (i=0;i<=N;i=i+1)
{
  app.templates.soy(comment);
}

var finish_time = new Date().getTime();
console.log("soy " + N);
console.log(N/(finish_time - start_time)*1000);


=== Results

Chromium 15.0

soy 50000
149253.73134328358
118764.84560570071

EJS 50000
144508.67052023122
142857.14285714287

doT 50000
526315.7894736842
561797.7528089888

underscore 50000
155279.50310559006
144092.2190201729


FireFox 3.6

underscore 50000
43290.04329004329
53134.96280552604

doT 50000
87565.67425569177
62344.13965087282

EJS 50000
51652.89256198347
54945.054945054944

soy 50000
36549.707602339186
36023.054755043224
Something went wrong with that request. Please try again.