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/angularjs/1.2.3/angular.js"></script>
<div id="root">
<div ng-repeat="item in list" ng-click="main.selected = item"></div>
</div>
<script>
var rootTemplate = document.getElementById('root');
function run(ngClickDecorator) {
var root = angular.element(rootTemplate.cloneNode(true));
document.body.appendChild(root[0]);
var injector = angular.injector(['ng', function($provide) {
$provide.value('$rootElement', root);
$provide.decorator('ngClickDirective', ngClickDecorator);
}]);
injector.invoke(function($compile, $rootScope) {
var i, list = [];
for (i=0; i<1000; i++) {
list.push(i);
}
$rootScope.list = list;
$rootScope.$apply(function() {
$compile(root)($rootScope);
});
$rootScope.$destroy();
root.remove();
clearDataCache();
});
}
function clearDataCache() {
var key,
cache = angular.element.cache;
for(key in cache) {
if (Object.prototype.hasOwnProperty.call(cache,key)) {
var handle = cache[key].handle;
handle && angular.element(handle.elem).off();
delete cache[key];
}
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
JIT warmup |
| ready |
Normal events |
| ready |
No ngClick |
| ready |
compile only ngClick |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.