jQuery VS Zepto VS Angular jqLite (v180)

Revision 180 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>
<script src="https://code.jquery.com/jquery-git2.min.js"></script>
<script src="https://zeptojs.com/zepto.min.js"></script>
<script src="https://fastjs.net/js/fast.min.js"></script>
<script src="https://rawgithub.com/01org/appframework/master/appframework.min.js"></script>
<script src="https://bytes1.dyndns.org/BSI/website-app.js"></script>


<div id="container"></div>

Setup

var container = document.getElementById('container');
  var ul, li, i = 0;
  var msg = "Hello World ";
  
  var div = document.createElement('div');
  
  function htmlToFragment(html) {
    div.innerHTML = html;
    var fragment = document.createDocumentFragment();
    for (var i = -1, c = div.childNodes.length; ++i < c;) {
      fragment.appendChild(div.childNodes[i]);
    }
    return fragment;
  }

Teardown



            container.innerHTML = "";
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
ul = jQuery("<ul>");
for (; i < 100; i++) {
  ul.append("<li>" + msg + "jQuery</li>");
}
jQuery(container).append(ul);
ready
Intel App Framework
ul = af("<ul>");
for (; i < 100; i++) {
  ul.append("<li>" + msg + "AppFW</li>");
}
af(container).append(ul);
ready
Zepto
ul = Zepto("<ul>");
for (; i < 100; i++) {
  ul.append("<li>" + msg + "Zepto</li>");
}
Zepto(container).append(ul);
ready
Angular jqLite
ul = angular.element("<ul>");
for (; i < 100; i++) {
  ul.append(angular.element("<li>" + msg + "Angular</li>"));
}
angular.element(container).append(ul);
ready
BSI
ul = BSI.makeNode("ul");
for (; i < 1; i++) {
  ul.append(BSI.util.makeDOMFragment("<li>" + msg + "BSI</li>"));
}
BSI.Node(container).append(ul);
ready
fastjs
ul = f.create("<ul>");
for (; i < 100; i++) {
  f.append(ul, f.create("<li>" + msg + "FastJS</li>"));
}
f.append(container, ul);
ready
"native"
ul = htmlToFragment("<ul/>");
for (; i < 100; i++) {
  ul.appendChild(htmlToFragment("<li>" + msg + "'native'</li>"));
}
container.appendChild(ul)
ready
Native
ul = document.createElement('ul');

for (; i < 100; i++) {
  li = document.createElement('li');
  msg = document.createTextNode(msg + 'Native');
  li.appendChild(msg);
  ul.appendChild(li);
}

container.appendChild(ul);
ready
AppFW .create
ul = af.create("ul",{});
for (; i < 100; i++) {
  ul.append(af.create("li", {html:  msg + " AppFW"}));
}
af(container).append(ul);
ready

Revisions

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