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>
Klass = function (methods) {
'use strict';
var extend = function (what, methods) {
var k;
for (k in methods) {
if (methods.hasOwnProperty(k)) { // kinda useless i guess
what.prototype[k] = methods[k];
}
}
},
include = function (to, from) {
var i = from.length - 1,
k;
for (i; i >= 0; i -= 1) {
for (k in from[i].prototype) {
if (from[i].prototype.hasOwnProperty(k)) {
to.prototype[k] = from[i].prototype[k];
}
}
}
};
function klass() {}
if (methods.Super) {
klass.prototype = new methods.Super();
extend(klass, methods, methods.Super);
} else {
klass.prototype = methods;
}
klass.prototype.constructor = klass;
if (methods.Implements) {
include(klass, methods.Implements);
}
return klass;
};
Klass2 = function (methods) {
'use strict';
var extend = function (what, methods) {
var k;
for (k in methods) {
what.prototype[k] = methods[k];
}
},
include = function (to, from) {
var i = from.length - 1,
k;
for (i; i >= 0; i -= 1) {
for (k in from[i].prototype) {
to.prototype[k] = from[i].prototype[k];
}
}
};
function klass() {}
if (methods.Super) {
klass.prototype = new methods.Super();
extend(klass, methods, methods.Super);
} else {
klass.prototype = methods;
}
klass.prototype.constructor = klass;
if (methods.Implements) {
include(klass, methods.Implements);
}
return klass;
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
hasOwnProperty |
| ready |
no Verfication |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.