jQ.Mobi (v43)

Revision 43 of this benchmark created on


Preparation HTML

<script src="https://staging-ian.appmobi.com/game/zepto.min.js"></script>
<script src="https://staging-ian.appmobi.com/game/jq.mobi.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.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
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
Raw JS - Building DOM nodes
i, ul = document.createElement("ul");
for (; i < 100; i += 1) {
  li = document.createElement("li");
  li.innerText = 'hello world raw JS';
  ul.appendChild(li);
}
document.getElementById("container").appendChild(ul);
ready
some jQuery style, native performance with prototypes
ul = d.create("ul");
for (; i < 100; i += 1) {
  li = d.create("li");
  li.innerText = 'hello world almost raw JS';
  ul.append(li);
}
jq("#container")[0].append(ul);
ready

Revisions

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