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
var undefined = void(0);
var V = new Number(42);
var v = 42;
var x = /x/;
var opts = Object.prototype.toString;
function f1(o){
if(o === undefined) return "undefined";
if(o === null) return "null";
return opts.call(o).slice(8,-1);
}
function f2(o){
if(o === undefined) return "undefined";
if(o === null) return "null";
if(typeof o === "number") return "Number";
if(typeof o === "string") return "String";
if(typeof o === "function") return "Function";
if(typeof o === "boolean") return "Boolean";
return opts.call(o).slice(8,-1);
}
function f3(o){
if(o === undefined) return "undefined";
if(o === null) return "null";
if(typeof o !== "object"){
if(typeof o === "number") return "Number";
if(typeof o === "string") return "String";
if(typeof o === "function") return "Function";
if(typeof o === "boolean") return "Boolean";
}
return opts.call(o).slice(8,-1);
}
function f4(o){
var t;
if(o === null) return "null";
if((t = typeof o) !== "object"){
if(o === undefined) return "undefined";
if(t === "number") return "Number";
if(t === "string") return "String";
if(t === "function") return "Function";
if(t === "boolean") return "Boolean";
}
return opts.call(o).slice(8,-1);
}
function f5(o){
var t;
if(o === null) return "null";
if((t = typeof o) !== "object"){
if(t === "undefined") return "undefined";
if(t === "number") return "Number";
if(t === "string") return "String";
if(t === "function") return "Function";
if(t === "boolean") return "Boolean";
}
return opts.call(o).slice(8,-1);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
V 1 |
| ready |
v 1 |
| ready |
x 1 |
| ready |
V 3 |
| ready |
v 3 |
| ready |
x 3 |
| ready |
V 4 |
| ready |
v 4 |
| ready |
x 4 |
| ready |
V 5 |
| ready |
v 5 |
| ready |
x 5 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.