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
let map = new Map();
let obj = {};
let size = 5e6;
const benchMarkMapSet = size => {
for (let i = 0; i < size; i++) {
map.set(i, i);
}
};
const benchMarkObjSet = size => {
for (let i = 0; i < size; i++) {
obj[i] = i;
}
};
const benchMarkMapGet = size => {
for (let i = 0; i < size; i++) {
let x = map.get(i);
}
};
const benchMarkObjGet = size => {
for (let i = 0; i < size; i++) {
let x = obj[i];
}
};
map = new Map();
obj = {};
Ready to run.
Test | Ops/sec | |
---|---|---|
Map Set |
| ready |
Object Set |
| ready |
Map Get |
| ready |
Object Get |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.