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>
function foo(x, y, z) {
return x + y * z;
}
function fooApply() {
var args = [];
for (var i = 2, len = arguments.length; i < len; i++) {
args[args.length] = arguments[i];
}
foo.apply(null, args);
}
function barApply() {
bar(arguments);
}
function bar(args) {
var x = args[2];
var y = args[3];
var z = args[4];
return x + y * z;
}
function barApply2(args) {
bar2(args);
}
function bar2(args) {
var x = args[2];
var y = args[3];
var z = args[4];
return x + y * z;
}
function barApplyZ(args, z) {
bar2(args, z);
}
function bar2(args, z) {
var x = args[2];
var y = args[3];
return x + y * z;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
apply |
| ready |
pass in args via arguments |
| ready |
pass in args via own array |
| ready |
all but last in array |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.