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
class TargetClass {
count = 0;
doWork() {
this.count += 1;
}
}
let thisFuncCount = 0;
let paramFuncCount = 0;
let thisLambdaCount = 0;
let paramLambdaCount = 0;
function thisFunc(param) {
thisFuncCount += param;
this.doWork();
}
function paramFunc(target, param) {
paramFuncCount += param;
target.doWork();
}
function executeWithThis(lambda, target) {
lambda.call(target, 2);
}
function executeWithParam(lambda, target) {
lambda(target, 2);
}
const sharedTarget = new TargetClass();
Ready to run.
Test | Ops/sec | |
---|---|---|
This, func, shared |
| ready |
Param, func, shared |
| ready |
Param, lambda, shared |
| ready |
Param, lambda, not shared |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.