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 obj = {};
var n = 3;
var nl = null;
var un = undefined;
var s = 'str';
var ar = [];
var fn = function() {};
function isObject(value){return value != null && typeof value === 'object';}
function isObject1(value){return value !== null && typeof value === 'object';}
function isObject2(value){return typeof value === 'object' && value != null;}
function isObject3(value){return typeof value === 'object' && value !== null;}
function isObject4(value){return !!(value && (typeof value === 'object' || typeof value === 'function')); }
function isObject5(value){return value && value !== null && typeof value === 'object';}
function isObjectLoDash(value) {
// avoid a V8 bug in Chrome 19-20
// https://code.google.com/p/v8/issues/detail?id=2291
var type = typeof value;
return type == 'function' || (value && type == 'object') || false;
}
function isObject6(value) {
return value === Object(value);
}
function isObject7(value) {
return value === {};
}Ready to run.
| Test | Ops/sec | |
|---|---|---|
| isObject | | ready |
| isObject1 | | ready |
| isObject2 | | ready |
| isObject3 | | ready |
| isObject4 | | ready |
| isObject5 | | ready |
| isObjectLoDash | | ready |
| isObject6 | | ready |
| Test 9 | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.