AngularJS forEach vs Native forEach (v49)

Revision 49 of this benchmark created by Ishan Misra on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js">
</script>
<script>
  var len = 1000;
  var arr = new Array();
  while (len--) {
    arr[len] = len;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Native forEach
arr.forEach(function(item) {item;});
ready
AngularJS forEach
angular.forEach(arr, function(item) {item;});
ready
for key in arr
for (var key in arr) {
  arr[key];
}
ready
for
for(var idx = 0; idx<arr.length; idx++){
arr[idx];
}
ready

Revisions

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