pc templating comparison4 (v5)

Revision 5 of this benchmark created by inner on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://rawgit.com/mojo-js/paperclip.js/master/dist/paperclip.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.0/react.min.js"></script>

<script src="https://rawgit.com/lhorie/mithril.js/next/mithril.js"></script>

Setup

window.placeholder = document.createElement("div");
    
    
    
    window.pcTpl = paperclip.template("<div>{{'item' + ~i}}<br /></div>");
    
    window.ReactElement = React.createClass({
      render: function () {
        return React.DOM.div(null, "item " + this.props.i, React.DOM.br());
      }
    });
    
    window.mithrilElement = function(i) { return m("div",["item"+i, m("br")]); };
    
    window.mithrilElementPrecompiled = function(i) { return {
      tag: "div",
      children: [
        "item"+i,
        {tag: "br"}
      ]
    };};

Teardown


    window.placeholder = document.createElement("div");
  

Test runner

Ready to run.

Testing in
TestOps/sec
paperclip
placeholder.appendChild(pcTpl.view({ i: Math.random() }).render());
ready
react
React.renderComponent(ReactElement({ i: Math.random() }), placeholder)
 
ready
paperclip recycle
var v = pcTpl.view({ i: Math.random() });
placeholder.appendChild(v.render());
v.dispose();
ready
mithril
m.render(placeholder, mithrilElement(Math.random()));
ready
mithril precompiled
m.render(placeholder, mithrilElementPrecompiled(Math.random()));
ready

Revisions

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

  • Revision 1: published by Craig on
  • Revision 5: published by inner on