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
function log(l){
return l+l;
}
Klass1 = function() {
this.testProp = "Hello World";
};
Klass1.prototype.foo = function() {
log(this.testProp);
};
Klass1.prototype.bar = function() {
log(this.testProp);
};
Klass2 = function() {
return {
testProp: "Hello World",
foo: function() {
log(this.testProp);
},
bar: function() {
log(this.TestProp);
}
};
};
var FooFunction = function(v) {
log(this.testProp);
}, BarFunction = function(v) {
log(this.testProp);
};
function Klass3() {
this.testProp = "Hello World";
this.foo = FooFunction;
this.bar = BarFunction;
}
var Klass4 = (function () {
function Klass4() {
this.hello = "Hello World";
}
Klass4.prototype.foo = function () {
log(this.hello);
}
Klass4.prototype.bar = function () {
log(this.hello);
}
return Klass4;
})();
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototypal |
| ready |
Module pattern |
| ready |
Module pattern with cached functions |
| ready |
Class pattern |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.