AngularJS: digest 1.2.12 vs 1.3.14

JavaScript performance comparison

Revision 64 of this test case created by

Preparation code

<script src="https://code.angularjs.org/1.2.12/angular.min.js"></script>
<script> angularBase = angular; angular = undefined;</script>

<script src="https://code.angularjs.org/1.3.14/angular.min.js"></script>
<script> angularExp = 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' + j] = {
          b: {
            c: 1
          }
        };
        child.$watch('a' + j + '.b.c', function() {});
      }
    }
    return rootScope;
  }
  
  
  var baseScope = createScopeTree(angularBase);
  var expScope = createScopeTree(angularExp);

};

Benchmark.prototype.teardown = function() {
  baseScope = null;
  expScope = null;

};
</script>

Preparation code output

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
Angular 1.2.12
baseScope.$digest();
pending…
Angular 1.3.14
expScope.$digest();
pending…

Compare results of other browsers

Revisions

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

0 Comments