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 keyF = function(y,x) {
return y*1000+x;
}
var mWidth = 500;
var map = new Map();
var bitMap = [];
var matrix = [];
var linearMatrix = [];
var obj = {};
for(let y = 0; y < 500;y++) {
matrix[y] = []
let bits = 0;
for(let x = 0; x < mWidth; x++) {
let val = { val: x%2 == 0 };
matrix[y][x] = val
linearMatrix[y*mWidth+x] = val;
obj[keyF(y,x)] = val;
map.set(keyF(y,x), val);
if(val.val){
bits |= (1 << (mWidth - x - 1))
}
}
bitMap[y] = bits;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
matrix access |
| ready |
object access |
| ready |
matrix access opt |
| ready |
linear matrix access |
| ready |
bitmap access |
| ready |
map access |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.