jQuery 2.0b VS jQ.Mobi VS zepto VS ten.js VS Angular jqLite VS BSI (v137)

Revision 137 of this benchmark created on


Description

This is an edited test from http://jsperf.com/jqm3/131.

Cleaned up setup and teardown methods and added BSI into the mix. Also standardized the text of the inserted li elements.

Preparation HTML

<div id="container"></div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="//zeptojs.com/zepto.min.js"></script>
<script src="//cdn.jqmobi.com/jq.mobi.min.js"></script>
<script src="//code.jquery.com/jquery-2.0.2.js"></script>
<script src="//lordsnow.net/kvf/ten/ten.min.js"></script>
<script src="//bytes1.dyndns.org/BSI/website-app.js"></script>
<script src="//cdn.app-framework-software.intel.com/2.0/appframework.min.js"></script>

Setup

//Lets add the append method to all html dom nodes:
    HTMLElement.prototype.append = function(el) {
      this.appendChild(el);
    }
    
    var container = document.getElementById('container');
    var ul, li, i = 0;

Teardown


    container.innerHTML = "";
  

Test runner

Ready to run.

Testing in
TestOps/sec
jQ.Mobi
ul = jq("<ul/>");
for (; i < 100; i += 1) {
  li = jq("<li>hello world</li>");
  ul.append(li);
}
jq(container).append(ul);
ready
jQuery
ul = jQuery("<ul/>");
for (; i < 100; i += 1) {
  li = jQuery("<li>hello world</li>");
  ul.append(li);
}
jQuery(container).append(ul);
ready
ten.js
ul = ten("<ul/>");
for (; i < 100; i += 1) {
  li = ten("<li>hello world</li>");
  ul.append(li);
}
ten(container).append(ul);
ready
Zepto
ul = Zepto("<ul/>");
for (; i < 100; i += 1) {
  li = Zepto("<li>hello world</li>");
  Zepto(ul).append(li);
}
Zepto(container).append(ul);
ready
Angular jqLite
ul = angular.element("<ul/>");
for (; i < 100; i += 1) {
  li = angular.element("<li>hello world</li>");
  ul.append(li);
}
angular.element(container).append(ul);
ready
BSI
ul = BSI.makeNode("ul");
for (; i < 100; i += 1) {
  li = BSI.util.makeDOMFragment("<li>hello world</li>");
  ul.append(li);
}
BSI.Node(container).append(ul);
ready
App Framework
ul = af("<ul/>");
for (; i < 100; i += 1) {
  li = af("<li>hello world</li>");
  ul.append(li);
}
af(container).append(ul);
ready

Revisions

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