jQuery.each vs. for loop vs Ext.Array.each (v260)

Revision 260 of this benchmark created by Dave on


Description

Another one

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="http://cdn.sencha.io/ext-4.1.0-gpl/ext-all.js">
</script>
<script>
  $.fn.forEach = Array.prototype.forEach;
  var extArrayEach = Ext.Array.each;
  var a = $('*');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Loop Backwards
var i = a.length;
while (!--i) {
  var e = a[i];
} // this looks k00l
ready
for loop
for (var i = 0, len = a.length; i < len; i++) {
  var e = a[i];
};
ready
forEach
a.forEach(function(node, index) {
  var e = node;
});
ready
Ext.Array.each
extArrayEach(a, function(index, node) {
  var e = node;
});
ready
Jquery For Each
$.each(a, function(index, node) {
  var e = node;
});
ready
Loop 2
var i = a.length;
while (--i) {
  var e = a[i];
}
ready

Revisions

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