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
Compares speed of module patter (e.g., return {// ...};) vs prototype based objects
<script>
var ProtoObj = function(_a, _b, _c) {
this.a = _a;
this.b = _b;
this.c = _c;
}
ProtoObj.prototype.func1 = function() {
return this.a;
}
ProtoObj.prototype.func2 = function() {
return this.b;
}
ProtoObj.prototype.func3 = function() {
return this.c;
}
var ModuleObj = function(_a, _b, _c) {
return {
a: _a,
b: _b,
c: _c,
func1: function() {
return this.a;
},
func2: function() {
return this.b;
},
func3: function() {
return this.c;
}
};
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Module Object Creation |
| ready |
Prototype Object Creation |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.