jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Check angular js performance with and without splitting variables to smaller scopes.
<html ng-app>
<head>
<script src="http://code.jquery.com/jquery-1.7.2.min.js">
</script>
<script src="http://code.angularjs.org/angular-1.0.1.min.js">
</script>
<script>
var myApp = angular.module('myApp',[]);
var scope;
var scope2;
function MyCtrl($scope) {
$scope.name = 'Superhero';
$scope.data = [];
scope = $scope;
}
function MyCtrl2($scope) {
$scope.name = 'Superhero';
$scope.data = [];
scope2 = $scope;
}
function ANGClear(globalScope,data){
globalScope.data.splice(0, ang_scope.data.length);
globalScope.$apply();
}
function ANGPush(globalScope,data){
globalScope.data.push(data);
globalScope.$apply();
}
</script>
</head>
<body>
<div ng-controller="MyCtrl">
Hello, {{name}}!
<span ng-repeat="item in data">{{item}} </span>
</div>
<div ng-controller="MyCtrl2">
Hello, {{name}}!
<span ng-repeat="item in data">{{item}} </span>
</div>
</body>
</html>
Ready to run.
Test | Ops/sec | |
---|---|---|
1000 elems |
| ready |
500 elem, two controllers |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.