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
Testing th post;
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js"></script>
<div ng-app="jsperfApp">
<div ng-controller="TasksCtrl">
<ul class="tasks">
<li ng-repeat="task in tasks" task="task" class="task"> </li>
</ul>
</div>
<div ng-controller="TasksCtrlIndex">
<ul class="tasks">
<li ng-repeat="task in tasks track by task.id" task="task" class="task"></li>
</ul>
</div>
</div>
<script>
var testApp = angular.module('jsperfApp', []);
window.testApp=testApp;
testApp.directive('task', function() {
return {
scope: {
task: '='
},
template: '{{ task.title }} <span class="time">({{ prettyTaskDate }})</span>',
link: function(scope) {
scope.$watch('task.date', function() {
scope.prettyTaskDate = scope.task.date;
});
}
};
})
.controller('TasksCtrl', function($scope) {
$scope.tasks = [];
window.tasksRepeat = $scope;
})
.controller('TasksCtrlIndex', function($scope) {
$scope.tasks = [];
window.tasksRepeatIndex = $scope;
});
;
window.clearScopes = function(){
window.tasksRepeat.tasks = [];
window.tasksRepeat.$digest();
window.tasksRepeatIndex.tasks = [];
window.tasksRepeatIndex.$digest();
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
ng-repeat |
| ready |
ng-repeat with track by index |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.