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 string = Object("abc");
var Object__toString = Object.prototype.toString;
function typeOf(object) {
var type = typeof object;
switch (type) {
case "object":
case "unknown":
return object == null ? "null" : "valueOf" in object // JS object
? "getUTCDay" in object ? "object" : typeof object.valueOf() // underlying type
: /native code/.test(object) ? "function" : "object";
case "function":
return "call" in object ? "function" : "object";
default:
return type;
}
};
var object = document.childNodes;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
constructor |
| ready |
instanceof |
| ready |
duck type |
| ready |
Object::toString |
| ready |
{}.toString |
| ready |
valueOf() |
| ready |
typeof()) |
| ready |
combination |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.