pc templating comparison4

Benchmark created by Craig on


Preparation HTML

<script src="//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="//cdnjs.cloudflare.com/ajax/libs/react/0.12.0/react.min.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());
      }
    });

Teardown


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

Test runner

Ready to run.

Testing in
TestOps/sec
paperclip
placeholder.appendChild(pcTpl.bind({ i: Math.random() }).render());
ready
react
React.renderComponent(ReactElement({ i: Math.random() }), placeholder)
 
ready
paperclip recycle
var v = pcTpl.bind({ i: Math.random() });
placeholder.appendChild(v.render());
v.remove();
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