AngularJS Digest 1.2 vs 1.3 vs 1.4

JavaScript performance comparison

Revision 73 of this test case created by Luciano

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<script> angular125 = angular; angular = undefined;</script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script>
<script> angular1216 = angular; angular = undefined;</script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>
<script> angular1309 = angular; angular = undefined;</script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.0/angular.min.js"></script>
<script> angular14 = angular; angular = undefined;</script>
      
<script>
Benchmark.prototype.setup = function() {
  function createScopeTree(angular) {
    var rootScope = angular.injector(['ng']).get('$rootScope');
  
    for (var i = 0; i < 100; i++) {
      var child = rootScope.$new();
      for (var j = 0; j < 100; j++) {
        child.a = {
          b: {
            c: 1
          }
        };
        child.$watch('a.b.c', function() {});
      }
    }
    return rootScope;
  }
  
  
  var ang125Scope = createScopeTree(angular125);
  var ang1216Scope = createScopeTree(angular1216);
  var ang1309Scope = createScopeTree(angular1309);
  var ang14Scope = createScopeTree(angular14);

};

Benchmark.prototype.teardown = function() {
  ang125Scope = null;
  ang1216Scope = null;
  ang130b8Scope = null;
  ang14Scope = null;

};
</script>

Preparation code output

<script> angular125 = angular; angular = undefined;</script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script> <script> angular1216 = angular; angular = undefined;</script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script> <script> angular1309 = angular; angular = undefined;</script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.0/angular.min.js"></script> <script> angular14 = angular; angular = undefined;</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec

Revisions

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

0 Comments