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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<div ng-app="testApp" ng-controller="testCtrl">
<div ng-repeat="item in includeItems">
<div ng-include="item.template"></div>
</div>
<div ng-repeat="item in directiveItems">
<div item-directive="item"></div>
</div>
</div>
<script>
angular
.module("testApp", [])
.directive("itemDirective", function() {
return {
restrict: "A",
scope: false,
replace: false,
transclude: false,
template: "id: {{ item.id }}",
link: function($scope, $element, $attributes) {
}
};
})
.controller("testCtrl", function($scope, $templateCache) {
$scope.items = [];
$scope.includeItems = [];
$scope.directiveItems = [];
for (var i = 0; i < 10; i ++)
$scope.items.push({ id: i, template: "item.tmpl" });
$templateCache.put("item.tmpl", "id: {{ item.id }}");
window.testScope = $scope;
});
</script>
window.testScope.includeItems = [];
window.testScope.directiveItems = [];
window.testScope.$digest();
window.testScope.includeItems = [];
window.testScope.directiveItems = [];
window.testScope.$digest();
Ready to run.
Test | Ops/sec | |
---|---|---|
ngInclude |
| ready |
Template Directive |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.