Angular VS AvalonJs VS Ember

JavaScript performance comparison

Revision 539 of this test case created by fengyie007

Preparation code

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js"></script>
<script src="http://rubylouvre.github.io/mvvm/javascripts/avalon.js"></script>
<script src="http://builds.emberjs.com/tags/v1.10.0/ember.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
 <!-- Angular -->
    <div>
        Angular 1.2:
        <span ng-controller="Ctrl" id="angList"><span ng-repeat="item in data">{{item}}</span></span>
    </div>

    <!-- Avalon -->
    <div>
        Avalon Js:
        <span ms-controller="AVCtrl" id="avaList"><span ms-repeat="data">{{el}}</span></span>
    </div>

    <!-- Ember -->

    <div id="emapp">
        <script type="text/x-handlebars">
            Ember:
    <span>
      {{#each EMapp.data}}<span>{{this}}</span>{{/each}}
    </span>
        </script>
    </div>
<script>
var Ctrl = function($scope){
        $scope.data = [];
    };


$(document).ready(function() {
  var timeout = 0;
  angular.element(document).ready(function() {
    angular.bootstrap(document);
    var ang_scope = $('#angList').scope();

    window.ANGclear = function() {
      ang_scope.data.splice(0, ang_scope.data.length);
      ang_scope.$digest();
    };
    window.ANGpush = function(data) {
      ang_scope.data.push(data);
      ang_scope.$digest();
    };
  });

  avalon.ready(function() {
    var vmodel = avalon.define("AVCtrl", function(vm) {
      vm.data = []
    });
    window.AVclear = function() {
      vmodel.data.splice(0, vmodel.data.length);
    };
    window.AVpush = function(data) {
      vmodel.data.push(data + vmodel.data.length);
    };
  });

  EMapp = Ember.Application.create({
    rootElement: '#emapp'
  });
  EMapp.data = Ember.A();

  window.EMclear = function() {
    EMapp.data.clear();
  };
  window.EMpush = function(data) {
    EMapp.data.pushObject(data);
  };
});

</script>
    

Preparation code output

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js"></script> <script src="http://rubylouvre.github.io/mvvm/javascripts/avalon.js"></script> <script src="http://builds.emberjs.com/tags/v1.10.0/ember.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script> <!-- Angular --> <div> Angular 1.2: <span ng-controller="Ctrl" id="angList"><span ng-repeat="item in data">{{item}}</span></span> </div> <!-- Avalon --> <div> Avalon Js: <span ms-controller="AVCtrl" id="avaList"><span ms-repeat="data">{{el}}</span></span> </div> <!-- Ember --> <div id="emapp"> <script type="text/x-handlebars"> Ember: <span> {{#each EMapp.data}}<span>{{this}}</span>{{/each}} </span> </script> </div> <script> var Ctrl = function($scope){ $scope.data = []; }; $(document).ready(function() { var timeout = 0; angular.element(document).ready(function() { angular.bootstrap(document); var ang_scope = $('#angList').scope(); window.ANGclear = function() { ang_scope.data.splice(0, ang_scope.data.length); ang_scope.$digest(); }; window.ANGpush = function(data) { ang_scope.data.push(data); ang_scope.$digest(); }; }); avalon.ready(function() { var vmodel = avalon.define("AVCtrl", function(vm) { vm.data = [] }); window.AVclear = function() { vmodel.data.splice(0, vmodel.data.length); }; window.AVpush = function(data) { vmodel.data.push(data + vmodel.data.length); }; }); EMapp = Ember.Application.create({ rootElement: '#emapp' }); EMapp.data = Ember.A(); window.EMclear = function() { EMapp.data.clear(); }; window.EMpush = function(data) { EMapp.data.pushObject(data); }; }); </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
AvalonJs
AVclear();
for (var i = 0; i < 100; i++)
  AVpush("witem" + i);
pending…
Ember
EMclear();
for (var i = 0; i < 100; i++)
  EMpush("eitem" + i);
pending…
Angular
ANGclear();

for (var i = 0; i < 100; i++)
  ANGpush("nitem" + i);
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

Angular 1.2: {{item}}
Avalon Js: {{el}}