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
const emptyArray = [];
const emptyArrayWithFoo =[];
emptyArrayWithFoo.foo='some other data';
const emptyObject = {};
const emptyObjectWithFoo = {};
emptyObjectWithFoo.foo = 'some other data';
const arrLength = 1e6;
const typedArray = new Uint32Array(arrLength);
const preAllocatedArray = Array(arrLength ).fill(0);
const preAllocatedArrayWithFoo = Array(arrLength ).fill(0);
preAllocatedArrayWithFoo.foo = 'some other data';
const preAllocatedObj = Object.fromEntries(Object.entries(preAllocatedArray ));
const preAllocatedObjWithFoo = Object.fromEntries(Object.entries(preAllocatedArray ));
preAllocatedObjWithFoo.foo = 'some other data';
function rand(){return Math.random()*arrLength | 0}
Ready to run.
Test | Ops/sec | |
---|---|---|
Empty Array |
| ready |
Pre Allocated Array |
| ready |
Empty Array with Extra Field |
| ready |
Pre Allocated Array with Extra Field |
| ready |
Typed Array (must be pre allocated) |
| ready |
Empty Object |
| ready |
Pre Allocated Object |
| ready |
Empty Object with Extra Field |
| ready |
Pre Allocated Object with Extra Field |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.