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 generateRandomString = (len) => Math.random().toString(36).substring(2, len + 2);
const array = [];
for(let i = 0; i < 10000; i++) {
const o = {
id: generateRandomString(10),
bbox: [0.47181372549019607, 0.5016339869281046, 0.0718954248366013, 0.08714596949891068],
segmentation: [],
image: "cyeQiUtiQ8KWMFojiy5KaA.jpg",
area: 413562
};
array.push(o);
}
const map = array.reduce((acc, o) => ({...acc, [o.id]: o}), {});
const indexToRetrieve = parseInt(Math.random() * 10000);
const objectId = array[indexToRetrieve].id;
Ready to run.
Test | Ops/sec | |
---|---|---|
Finding object by browsing an array |
| ready |
Accessing object by key |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.