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

JavaScript performance comparison

Revision 133 of this test case created by

Preparation code

<div id="container"></div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js">
</script>
<script src="https://zeptojs.com/zepto.min.js"></script>
<script src="https://cdn.jqmobi.com/jq.mobi.min.js"></script>
<script src="https://code.jquery.com/jquery-2.0.2.js"></script>
<script src="https://lordsnow.net/kvf/ten/ten.min.js"></script>
<script src="http://bytes1.dyndns.org/BSI/website-app.js"></script>
      
<script>
Benchmark.prototype.setup = function() {
  //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;

};

Benchmark.prototype.teardown = function() {
  container.innerHTML = "";

};
</script>

Preparation code output

<div id="container"></div> <script src="https://zeptojs.com/zepto.min.js"></script> <script src="https://cdn.jqmobi.com/jq.mobi.min.js"></script> <script src="https://code.jquery.com/jquery-2.0.2.js"></script> <script src="https://lordsnow.net/kvf/ten/ten.min.js"></script> <script src="http://bytes1.dyndns.org/BSI/website-app.js"></script>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
jQ.Mobi
ul = jq("<ul/>");
for (; i < 100; i += 1) {
  li = jq("<li>hello world</li>");
  ul.append(li);
}
jq(container).append(ul);
pending…
jQuery
ul = jQuery("<ul/>");
for (; i < 100; i += 1) {
  li = jQuery("<li>hello world</li>");
  ul.append(li);
}
jQuery(container).append(ul);
pending…
ten.js
ul = ten("<ul/>");
for (; i < 100; i += 1) {
  li = ten("<li>hello world</li>");
  ul.append(li);
}
ten(container).append(ul);
pending…
Zepto
ul = Zepto("<ul/>");
for (; i < 100; i += 1) {
  li = Zepto("<li>hello world</li>");
  Zepto(ul).append(li);
}
Zepto(container).append(ul);
pending…
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);
pending…
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);
pending…

Compare results of other browsers

Revisions

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

0 Comments