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

JavaScript performance comparison

Revision 148 of this test case created by

Preparation code

<script src="https://zeptojs.com/zepto.min.js">
</script>
<script src="https://cdn.jqmobi.com/jq.mobi.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js">
</script>
</script>
<script src="http://lordsnow.net/kvf/ten/ten.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js">
</script>
<div id="container">
</div>
      
<script>
Benchmark.prototype.setup = function() {
  var d = {};
  d.id = function(el) {
    return document.getElementById(el);
  }
  d.create = function(el) {
    return document.createElement(el);
  }
  
  //Lets add the append method to all html dom nodes:
  HTMLElement.prototype.append = function(el) {
    this.appendChild(el);
  }
  var container = d.id('container');
  var ul, li, i = 0;

};

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

};
</script>

Preparation code output

<script src="https://cdn.jqmobi.com/jq.mobi.min.js"> </script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"> </script> </script> <script src="http://lordsnow.net/kvf/ten/ten.min.js"> </script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"> </script> <div id="container"> </div>

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 jq.Mobi</li>");
  ul.append(li);
}
jq(d.id('container')).append(ul);
pending…
jQuery
ul = jQuery("<ul/>");
for (; i < 100; i += 1) {
  li = jQuery("<li>hello world jQuery</li>");
  ul.append(li);
}
jQuery(d.id('container')).append(ul);
pending…
ten.js
ul = ten("<ul/>");
for (; i < 100; i += 1) {
  li = ten("<li>hello world ten.js</li>");
  ul.append(li);
}
ten(d.id('container')).append(ul);
pending…
Zepto
ul = Zepto("<ul/>");
for (; i < 100; i += 1) {
  li = Zepto("<li>hello world Zepto</li>");
  Zepto(ul).append(li);
}
Zepto(d.id('container')).append(ul);
pending…
Angular jqLite
ul = angular.element("<ul/>");
for (; i < 100; i += 1) {
  li = jQuery("<li>hello world jQuery</li>");
  ul.append(li);
}
angular.element(d.id('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