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
<script>
var Object__toString = {}.toString;
var isArrayN = Array.isArray;
function isArray1(object) {
return object != null && Object__toString.call(object) === "[object Array]";
}
function isArray2(object) {
if (object == null || !object.valueOf) return false;
if (object instanceof Array) return true;
return Object__toString.call(object) === "[object Array]";
}
function isArrayWithInstanceof(object) {
return object instanceof Array
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Array.isArray |
| ready |
isArray1 |
| ready |
isArray2 |
| ready |
native isArray |
| ready |
isArray (instanceof) |
| ready |
instanceof |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.