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 mockdata = [];
function notToJson(val) {
return val !== val || val === Infinity || val === -Infinity;
}
for (var i = 0; i < 1000; i++) {
var n;
if (Math.random()>0.75) {
n = Math.floor(Math.random()*10000);
if (Math.random()>0.5) {
n = n.toString();
}
} else {
if (Math.random()>0.5) {
n = NaN;
} else {
if (Math.random()>0.5) {
n = Infinity;
} else {
n = -Infinity;
}
}
}
mockdata.push(n);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
typeof |
| ready |
notToJson |
| ready |
toString |
| ready |
JSON.stringify |
| ready |
Full typeof |
| ready |
Full notToJson |
| ready |
deleted |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.