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" perf-click="main.selected = item"></div>
</div>
<script>
var repeatCount = 500,
rootTemplate = document.getElementById('root');
function run(perfClickDirective) {
var root = angular.element(rootTemplate.cloneNode(true));
document.body.appendChild(root[0]);
angular.bootstrap(root, ['ng', function($compileProvider) {
if (perfClickDirective) {
$compileProvider.directive('perfClick', perfClickDirective);
}
return function($rootScope) {
var i, list = [];
for (i=0; i<repeatCount; i++) {
list.push(i);
}
$rootScope.list = list;
};
}]);
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 |
compile and link without event |
| ready |
compile only |
| ready |
no directive |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.