ExtJS .each vs loop (v2)

Revision 2 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 pi = Math.PI
  var a = new Array(10000),
      e;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Loop
var length = a.length;
for (var i = 0, len = length; i < len; i++) {
 e = pi;
};
ready
Ext.each
Ext.each(a, function() {
 e = pi;
});
ready
Array prototype
a.forEach(function() {
 e = pi;
});
ready

Revisions

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