jQuery.each vs. for loop vs Ext.Array.each

JavaScript performance comparison

Revision 172 of this test case created

Preparation code

<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>

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
jQuery.each
$.each(a, function(index, node) {
 var e = node;
});
pending…
for loop
for (var i = 0, len = a.length; i < len; i++) {
 var e = a[i];
};
pending…
for countdown
for (var i = a.length-1; i >= 0; i--) {
 var e = a[i];
};
pending…
Ext.Array.each
extArrayEach(a, function(index, node) {
 var e = node;
});
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:

0 comments

Add a comment