AngularJS Digest 1.2.28 vs 1.3.8 (v35)

Revision 35 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script>
<script> angular1228 = angular; angular = undefined;</script>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script> angular1310 = angular; angular = undefined;</script>

Setup

function createScopeTree(angular) {
      var rootScope, child, i, j;
      rootScope = angular.injector(['ng']).get('$rootScope');
    
      for (i = 0; i < 100; i++) {
        var child = rootScope.$new();
        for (j = 0; j < 100; j++) {
          child.a = {
            b: {
              c: 1
            }
          };
          child.$watch('a.b.c', function() {});
        }
      }
      return rootScope;
    }
    
    
    var ang1228Scope = createScopeTree(angular1228);
    var ang1310Scope = createScopeTree(angular1310);

Teardown


    ang1228Scope = null;
    ang1310Scope = null;
  

Test runner

Ready to run.

Testing in
TestOps/sec
Warmup 1.2.28
ang1228Scope.$digest();
ready
1.2.28
ang1228Scope.$digest();
ready
Warmup 1.3.10
ang1310Scope.$digest();
ready
1.3.10
ang1310Scope.$digest();
ready

Revisions

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