ExtJS .each vs loop (v15)

Revision 15 of this benchmark created on


Preparation HTML

<script src="http://dev.sencha.com/deploy/ext-4.1.0-gpl/ext.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;
for (var i = 0, len = length; i < len; i++) {
  var k = myArray[0];
 console.log(myArray[i] + k);
};
ready
Ext.each
Ext.each(myArray, function(value) {
  var k = myArray[0];
 console.log(value + k);
});
ready
Array prototype
myArray.forEach(function(n) {
  var k = myArray[0];
 console.log(n + k);
});
ready

Revisions

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