ExtJS .each vs loop (v30)

Revision 30 of this benchmark created on


Preparation HTML

<script src="http://cdn.sencha.com/ext/gpl/4.2.1/ext-all.js"></script>
<script>
  var myArray = new Array(1,2,3,4,5,6,7,8,9,10);
</script>

Test runner

Ready to run.

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

Revisions

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