ExtJS .each vs loop (v12)

Revision 12 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/ext-core/3.1.0/ext-core.js"></script>
<script>
  var myArray = new Array(1,2,3);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Loop
var length = myArray.length;
var indx = 5;
for (var i = 0, len = length; i < len; i++) {
  indx = myArray[i] + indx;
};
ready
Ext.each
var indx = 5;
Ext.each(myArray, function(value) {
 indx = value + indx;
});
ready
Array prototype
var indx = 5;
myArray.forEach(function(n) {
 indx = n + indx;
});
ready

Revisions

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