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 objConstructor = {}.constructor;
var obj = {
a: 'b',
c: 'd'
};
function jsCheck(obj) {
if (obj == null) return false;
return obj.constructor === objConstructor;
}
function jqueryCheck(obj) {
if (obj == null) return false;
var hasOwn = Object.prototype.hasOwnProperty;
// Not own constructor property must be Object
if (obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for (key in obj) {}
return key === undefined || hasOwn.call(obj, key);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
jQuery 1.4.4 similar |
| ready |
other way |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.