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 list = [];
var undef = void 0;
var undef2;
for (var i = 0; i !== 2000; i++) {
var rand = Math.floor(Math.random() * 1000) % 7;
switch (rand) {
case 0:
list[i] = 1;
break;
case 1:
list[i] = true;
break;
case 2:
list[i] = "c";
break;
case 3:
list[i] = [];
break;
case 4:
list[i] = {};
break;
case 5:
list[i] = void 0;
break;
case 6:
break;
}
}
window.BLACKHOLE = acc;
Ready to run.
Test | Ops/sec | |
---|---|---|
typeof undefined |
| ready |
=== undefined |
| ready |
=== undefined(1st local) |
| ready |
=== undefined(2nd local) |
| ready |
void 0 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.