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
Klass1 = function() {}
Klass1.prototype.foo = function() {
log('foo');
}
Klass1.prototype.bar = function() {
log('bar');
}
Klass2 = function() {
var foo = function() {
log('foo');
},
bar = function() {
log('bar');
};
return {foo: foo, bar: bar}
}
var FooFunction = function() {
log('foo');
}, BarFunction = function() {
log('bar');
};
Klass3 = function() {
return {foo: FooFunction, bar: BarFunction}
}
Klass4 = function() {
return {foo: function() { log('foo'); }, bar: function() { log('bar'); }}
}
Klass5 = function() {
this.foo = function() {
log('foo');
};
this.bar = function() {
log('bar');
};
}
Klass6 = {
foo: function() {
log('foo');
},
bar: function() {
log('bar');
}
}
Klass7 = new(function() {
this.foo = function() {
log('foo');
};
this.bar = function() {
log('bar');
};
})();
Klass8 = new(function() {
function logg(m) {
log(m);
}
this.foo = function() {
logg('foo');
};
this.bar = function() {
logg('bar');
};
})();
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototypal |
| ready |
Module pattern |
| ready |
Module pattern with cached functions |
| ready |
Test3 with embedding... |
| ready |
Module pattern 2 |
| ready |
Declarative |
| ready |
Module Singleton |
| ready |
Module Singleton w/ inner function |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.