ExtJS .each vs loop (v11)

Revision 11 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++) {
 console.log(myArray[i] + indx);
};
ready
Ext.each
var indx = 5;
Ext.each(myArray, function(value) {
 console.log(value + indx);
});
ready
Array prototype
var indx = 5;
myArray.forEach(function(n) {
 console.log(n + indx);
});
ready

Revisions

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