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
numsamples = [2, 2.2, 'a', '2', '2 3', 0x00eef];
index = Math.floor(Math.random()*numsamples.length);
this.input = numsamples[index];
if (!Number.isInteger) {
// Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
Number.isInteger = function isInteger (nVal) {
return typeof nVal === "number" && isFinite(nVal) && nVal > -9007199254740992 && nVal < 9007199254740992 && Math.floor(nVal) === nVal;
};
}
Ready to run.
Test | Ops/sec | |
---|---|---|
isNaN |
| ready |
isFinite |
| ready |
typeof Number |
| ready |
isInteger |
| ready |
=== |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.