Transparency vs. Weld vs. Mustache (v26)

Revision 26 of this benchmark created by Joost on


Preparation HTML

<script src="http://mustache.github.com/extras/mustache.js"></script>
<script src="//rawgithub.com/hij1nx/weld/master/lib/weld.js"></script>
<script src=http://code.jquery.com/jquery-1.7.1.min.js></script>
<script src="//rawgit.com/leonidas/transparency/master/lib/jquery.transparency.min.js"></script>

<div id="transparencydiv">
  <h1 id="name">My Name</h1>
  <ul class="interests"><li class="interest">An interest</li></ul>
</div>

<div id="welddiv">
  <h1 id="name">My Name</h1>
  <ul><li class="interests">An interest</li></ul>
</div>

<div id="mustachediv">
   <h1>{{name}}</h1>
   <ul>
   {{#interests}}
     <li>{{interest}}</li>
   {{/interests}}
   </ul>
</div>

<div id="mustachediv-saved">
   <h1>{{name}}</h1>
   <ul>
   {{#interests}}
     <li>{{interest}}</li>
   {{/interests}}
   </ul>
</div>

Setup

var me = {
      "name": "Joshua Kehn",
      "interests": [
        "javascript",
        "node.js",
        "development",
        "programming"
      ]
    };
    
    var me_transparency = {
      "name": "Joshua Kehn",
      "interests": [{
        interest: "javascript"
      }, {
        interest: "node.js"
      }, {
        interest: "development"
      }, {
        interest: "programming"
      }]
    };
    
    var me_stach = {
      "name": "Joshua Kehn",
      "interests": [{
        "interest": "javascript"
      }, {
        "interest": "node.js"
      }, {
        "interest": "development"
      }, {
        "interest": "programming"
      }]
    };
    
    var weld_elem = document.getElementById('welddiv');
    var t_elem = $('#transparencydiv');
    var m_elem = document.getElementById('mustachediv');
    var m_saved = document.getElementById('mustachediv-saved');

Test runner

Ready to run.

Testing in
TestOps/sec
Transparency
t_elem.render(me_transparency);
ready
Weld
weld(weld_elem, me);
ready
Mustache
m_elem.innerHTML = Mustache.to_html(m_saved.innerHTML, me_stach);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 3: published by Jarno Keskikangas on
  • Revision 26: published by Joost on