Angular forEach performance (v9)

Revision 9 of this benchmark created on


Description

The original test was done on an empty array. This test is against a densely populated array.

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.min.js">
</script>

Setup

var arr = [];
    for(var i = 0; i < 10000; i++) {
      arr[i] = Math.random();
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Native forEach
arr.forEach(function(item) {});
ready
Angular forEach
angular.forEach(arr, function(item) {});
ready
Native For
for (var key in arr) {
  //arr[key];
}
ready

Revisions

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