jQuery 2.0b VS jQ.Mobi VS zepto VS ten.js (v143)

Revision 143 of this benchmark created on


Description

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 HTML

<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.3.js"></script></script>
<script src="//raw.github.com/kvonflotow/ten.js/master/ten.min.js"></script>
<div id="container"></div>

Setup

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;

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 jq.Mobi</li>");
  ul.append(li);
}
jq(d.id('container')).append(ul);
ready
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);
ready
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);
ready
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);
ready
Vanilla
ul = document.createElement('ul');
for (; i < 100; i += 1) {
  li = document.createElement('li');
  li.innerText = "hello world Zepto";
  ul.appendChild(li);
}
d.id('container').appendChild(ul);
ready
Vanilla2
ul = document.createElement('ul');
for (; i < 100; i += 1) {
  li = document.createElement('li');
  li.innerHTML = "hello world Zepto";
  ul.appendChild(li);
}
d.id('container').appendChild(ul);
ready

Revisions

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