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

JavaScript performance comparison

Revision 147 of this test case created

Info

This is an edited test from http://jsperf.com/jqm3/68 by levin, which is based on some other test.

All I did was add a test for ten.js and remove the native JavaScript tests.

Preparation code

<script src="//zeptojs.com/zepto.min.js"></script>
<script src="//rawgithub.com/01org/appframework/master/appframework.js"></script>
<script src="//code.jquery.com/jquery-2.0.3.js"></script></script>
<script src="//rawgithub.com/kvonflotow/ten.js/master/ten.min.js"></script>
<div id="container"></div>
<script>
Benchmark.prototype.setup = function() {
    var ul, li, i = 0;
};

Benchmark.prototype.teardown = function() {
    container.innerHTML = "";
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
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('#container').append(ul);
pending…
jQuery
ul = jQuery("<ul/>");
for (; i < 100; i += 1) {
  li = jQuery("<li>hello world jQuery</li>");
  ul.append(li);
}
jQuery("#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("#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("#container").append(ul);
pending…
AF Fast
ul = af.create("ul",{});
for (; i < 100; i += 1) {
   li = af.create("li",{innerHTML:"Hello App Framework"});
   ul.append(li);
}
af.query("#container").append(ul);
pending…
Vanilla2
ul = document.createElement('ul');
for (; i < 100; i += 1) {
  li = document.createElement('li');
  li.innerHTML = "hello world Zepto";
  ul.appendChild(li);
}
document.getElementById('container').appendChild(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. Here’s a list of current revisions for this page:

1 comment

Robert Cohn commented :

Changed github url so won't run into mime errors on chrome

Add a comment