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 getClass = {}.toString,
hasProperty = {}.hasOwnProperty,
expression = /Kit/g;
function Test() {}
// Checks the internal [[Class]] name of the object.
function isFunctionA(object) {
return object && getClass.call(object) == '[object Function]';
}
// Partial duck-typing implementation by Garrett Smith.
function isFunctionB(object) {
if (typeof object != 'function') return false;
var parent = object.constructor && object.constructor.prototype;
return parent && hasProperty.call(parent, 'call');
}
// Pure duck-typing implementation taken from Underscore.js.
function isFunctionC(object) {
return !!(object && object.constructor && object.call && object.apply);
}
function isFunctionD(object) {
return !!(object && object typeof Function);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
isFunctionA |
| ready |
isFunctionC |
| ready |
isFunctionD |
| ready |
isFunctionB |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.