AngularJS: digest (v41)

Revision 41 of this benchmark created by hayato on


Preparation HTML

<script src="https://code.angularjs.org/1.0.1/angular-1.0.1.min.js"></script>
<script> angularLegacy = angular; angular = undefined;</script>

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

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.7/angular.min.js"></script>
<script> angularExp = angular; angular = undefined;</script>

Setup

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 baseScope = createScopeTree(angularBase);
    var expScope = createScopeTree(angularExp);
    var legScope = createScopeTree(angularLegacy);

Teardown


    baseScope = null;
    expScope = null;
    legScope = null;
  

Test runner

Ready to run.

Testing in
TestOps/sec
Base
baseScope.$digest();
ready
Experiment
expScope.$digest();
ready
Legacy
legScope.$digest();
ready

Revisions

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