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
// Create a function to generate large objects
function createLargeObject() {
return {
id: Math.random().toString(36).substr(2, 9),
name: `User ${Math.floor(Math.random() * 10000)}`,
email: `user${Math.floor(Math.random() * 10000)}@example.com`,
data: {
preferences: {
theme: Math.random() > 0.5 ? 'dark' : 'light',
notifications: Math.random() > 0.5,
language: ['en', 'es', 'fr', 'de'][Math.floor(Math.random() * 4)]
},
stats: {
loginCount: Math.floor(Math.random() * 1000),
lastActive: new Date(Date.now() - Math.random() * 86400000 * 30),
score: Math.random() * 100
},
metadata: {
createdAt: new Date(Date.now() - Math.random() * 86400000 * 365),
tags: Array.from({length: Math.floor(Math.random() * 5) + 1},
() => `tag${Math.floor(Math.random() * 100)}`),
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '.repeat(Math.floor(Math.random() * 5) + 1)
}
}
};
}
// Create the arrays with large objects
let arr1 = [...Array(64_000)].map(() => createLargeObject());
let arr2 = [...Array(64_000)].map(() => createLargeObject());
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| concat | | ready |
| push (spread) | | ready |
| push (apply) | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.