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 smallMapStrings = new Map();
var smallMapNumbers = new Map();
var largeMapStrings = new Map();
var largeMapNumbers = new Map();
var smallObjStrings = {}
var smallObjNumbers = {}
var largeObjStrings = {};
var largeObjNumbers = {};
for (var i=0; i<10_000 ; i++) {
if (i < 10) {
smallMapStrings.set(`key${i}`, Math.random());
smallMapNumbers.set(i, Math.random());
smallObjStrings[`key${i}`] = Math.random();
smallObjNumbers[i] = Math.random();
}
largeMapStrings.set(`key${i}`, Math.random());
largeMapNumbers.set(i, Math.random());
largeObjStrings[`key${i}`] = Math.random();
largeObjNumbers[i] = Math.random();
}
Ready to run.
Test | Ops/sec | |
---|---|---|
largeObjNumbers[miss] |
| ready |
smallObjStrings[miss] |
| ready |
smallMapNumbers.get(miss) |
| ready |
smallMapStrings.get(miss) |
| ready |
largeMapStrings.get(miss) |
| ready |
smallObjNumbers[miss] |
| ready |
largeMapNumbers.get(miss) |
| ready |
largeObjStrings[miss] |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.