ng perf

JavaScript performance comparison

Revision 813 of this test case created by

Preparation code

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.min.js"></script>

<div ng-app>
	Angular:
	<span ng-controller="Ctrl" id="angList"><span ng-repeat="item in data">{{item}}</span></span>
</div>


<script>
var Ctrl = function($scope){ $scope.data = []; };

$(document).ready(function() {
	angular
		.config(function($controllerProvider) {
			$controllerProvider.allowGlobals()
		})
		.element(document)
		.ready(function() {
			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.data.length);
				ang_scope.$digest();
			};
		});

});
</script>
    

Preparation code output

<div ng-app> Angular: <span ng-controller="Ctrl" id="angList"><span ng-repeat="item in data">{{item}}</span></span> </div>

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 10
ANGclear();
for (var i = 0; i < 10; i++)
  ANGpush("ngitem");
pending…
Angular 100
ANGclear();
for (var i = 0; i < 100; i++)
  ANGpush("ngitem");
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: {{item}}