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>
function A() {
var a = 0;
var b = 0;
var c = 0;
var d = 0;
this.m1 = function() {
a += 1;
b += 2;
c += 3;
d += a;
};
this.m2 = function() {
a += 4;
b += 5;
c += 6;
d += b;
};
this.m3 = function() {
a += 7;
b += 8;
c += 9;
d += c;
};
this.m = function() {
this.m1();
this.m2();
this.m3();
};
}
function B() {}
B.prototype.a = 0;
B.prototype.b = 0;
B.prototype.c = 0;
B.prototype.d = 0;
B.prototype.m1 = function() {
this.a += 1;
this.b += 2;
this.c += 3;
this.d += this.a;
};
B.prototype.m2 = function() {
this.a += 4;
this.b += 5;
this.c += 6;
this.d += this.b;
};
B.prototype.m3 = function() {
this.a += 7;
this.b += 8;
this.c += 9;
this.d += this.c;
};
B.prototype.m = function() {
this.m1();
this.m2();
this.m3();
};
C = function() {
var _m1 = function(o) {
o.a += 1;
o.b += 2;
o.c += 3;
o.d += o.a;
},
_m2 = function(o) {
o.a += 4;
o.b += 5;
o.c += 6;
o.d += o.b;
},
_m3 = function(o) {
o.a += 7;
o.b += 8;
o.c += 9;
o.d += o.c;
};
return {
m: function(o) {
_m1(o);
_m2(o);
_m3(o);
},
newC: function() {
return {
a: 0,
b: 0,
c: 0,
d: 0
};
}
};
}();
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
1. A, m3 |
| ready |
2. B, m3 |
| ready |
3. A, m10 |
| ready |
4. B, m10 |
| ready |
5. C, m3 |
| ready |
6. C, m10 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.