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
Check performance of === vs == in varying situations.
<script>
var u = undefined,
i = 0,
a = "0",
n = null,
e = '',
isU = function (v) { return typeof u === 'undefined'; },
isN = function (v) { return u === null; },
isUN = function (v) { return typeof u !== 'undefined' && u !== null; },
isUNfn = function (v) { return !isU(v) && !isN(v); },
isUNb = function (v) { return !!!v; };
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
u eqeqeq undefined |
| ready |
u eqeq undefined |
| ready |
typeof u eqeqeq 'undefined' |
| ready |
typeof u eqeq 'undefined' |
| ready |
i eqeqeq 0 |
| ready |
i eqeq 0 |
| ready |
i eqeqeq '0' |
| ready |
i eqeq '0' |
| ready |
a eqeqeq 0 |
| ready |
a eqeq 0 |
| ready |
a eqeqeq '0' |
| ready |
a eqeqeq '0' |
| ready |
n eqeqeq null |
| ready |
n eqeq null |
| ready |
n eqeqeq 0 |
| ready |
e eqeqeq '' |
| ready |
e eqeq '' |
| ready |
e.length eqeqeq 0 |
| ready |
e.length eqeqeq 0 |
| ready |
e.length !eqeq 0 |
| ready |
e.length !eq 0 |
| ready |
e.length |
| ready |
u |
| ready |
not u |
| ready |
not not u |
| ready |
not not not u |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.