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
var testObj = {
extra: 'properties',
to: 'hinder',
compiler: 'optimization',
A: 'A',
B: 'B',
C: 'C',
D: 'D',
E: 'E',
F: 'F',
G: 'G',
H: 'H',
I: 'I',
J: 'J',
K: 'K',
L: 'L',
M: 'M',
N: 'N',
O: 'O',
P: 'P',
Q: 'Q',
R: 'R',
S: 'S',
T: 'T',
U: 'U',
V: 'V',
W: 'W',
X: 'X',
Y: 'Y',
Z: 'Z',
getA: function () { return this.A; },
getB: function () { return this.B; },
getC: function () { return this.C; },
getD: function () { return this.D; },
getE: function () { return this.E; },
getF: function () { return this.F; },
getG: function () { return this.G; },
getH: function () { return this.H; },
getI: function () { return this.I; },
getJ: function () { return this.J; },
getK: function () { return this.K; },
getL: function () { return this.L; },
getM: function () { return this.M; },
getN: function () { return this.N; },
getO: function () { return this.O; },
getP: function () { return this.P; },
getQ: function () { return this.Q; },
getR: function () { return this.R; },
getS: function () { return this.S; },
getT: function () { return this.T; },
getU: function () { return this.U; },
getV: function () { return this.V; },
getW: function () { return this.W; },
getX: function () { return this.X; },
getY: function () { return this.Y; },
getZ: function () { return this.Z; }
};
var testObjGetters = [
testObj.getA, testObj.getB, testObj.getC, testObj.getD, testObj.getE, testObj.getF, testObj.getG, testObj.getH, testObj.getI, testObj.getJ, testObj.getK, testObj.getL, testObj.getM, testObj.getN, testObj.getO, testObj.getP, testObj.getQ, testObj.getR, testObj.getS, testObj.getT, testObj.getU, testObj.getV, testObj.getW, testObj.getX, testObj.getY, testObj.getZ
];
var getters = [
function (obj) { return obj.A; },
function (obj) { return obj.B; },
function (obj) { return obj.C; },
function (obj) { return obj.D; },
function (obj) { return obj.E; },
function (obj) { return obj.F; },
function (obj) { return obj.G; },
function (obj) { return obj.H; },
function (obj) { return obj.I; },
function (obj) { return obj.J; },
function (obj) { return obj.K; },
function (obj) { return obj.L; },
function (obj) { return obj.M; },
function (obj) { return obj.N; },
function (obj) { return obj.O; },
function (obj) { return obj.P; },
function (obj) { return obj.Q; },
function (obj) { return obj.R; },
function (obj) { return obj.S; },
function (obj) { return obj.T; },
function (obj) { return obj.U; },
function (obj) { return obj.V; },
function (obj) { return obj.W; },
function (obj) { return obj.X; },
function (obj) { return obj.Y; },
function (obj) { return obj.Z; }
];
var gettersThis = [
function () { return this.A; },
function () { return this.B; },
function () { return this.C; },
function () { return this.D; },
function () { return this.E; },
function () { return this.F; },
function () { return this.G; },
function () { return this.H; },
function () { return this.I; },
function () { return this.J; },
function () { return this.K; },
function () { return this.L; },
function () { return this.M; },
function () { return this.N; },
function () { return this.O; },
function () { return this.P; },
function () { return this.Q; },
function () { return this.R; },
function () { return this.S; },
function () { return this.T; },
function () { return this.U; },
function () { return this.V; },
function () { return this.W; },
function () { return this.X; },
function () { return this.Y; },
function () { return this.Z; }
];
var value = null;
if(value != 'Z') {
throw new Error('test ' + this.name + ' did not run correctly, last value is ' + value + ' should be \'Z\'');
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Dot Notation |
| ready |
Square Brackets |
| ready |
Anonymous Function Dot Notation |
| ready |
Anonymous Function Using 'this.' |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.