DOM vs innerHTML based Templating

JavaScript performance comparison

Revision 715 of this test case created by Roman


A brief comparison of some JavaScript templating engines on a short template: 7 DOM nodes ... 7 interpolated values.

Preparation code

<script src = "" >
<script src = "" >
  yr.register("test", "<ul>\nfor .items.item {\n  <li>{ .title }\n</li>\n  }\n</ul>");

  var list = [], item;
  for (var i = 0; i < 10000; i++) {
    item = {};
    for (var j = 0; j < 15; j++) {
      item[i] = i;

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Yate Template'test', list);

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Comment form temporarily disabled.

Add a comment