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
function createMsg() {
return { mid: crypto.randomUUID() };
}
var MESSAGE_COUNT = 10000;
var MAX_MESSAGE_COUNT_EVERY_SESSION = 20;
var SESSION_COUNT = MESSAGE_COUNT / MAX_MESSAGE_COUNT_EVERY_SESSION;
var ALL_MESSAGES = Array.from({ length: MESSAGE_COUNT }).map(() => createMsg());
var before = {
lists: Object.fromEntries(
Array.from({ length: SESSION_COUNT }).map((_, i) => [
`group-${i}`,
ALL_MESSAGES.slice(
i * MAX_MESSAGE_COUNT_EVERY_SESSION,
i * MAX_MESSAGE_COUNT_EVERY_SESSION + MAX_MESSAGE_COUNT_EVERY_SESSION,
),
]),
),
messages: Object.fromEntries(ALL_MESSAGES.map(item => [item.mid, item])),
};
var after = {
messages: Object.fromEntries(
Array.from({ length: SESSION_COUNT }).map((_, i) => [
`group-${i}`,
Object.fromEntries(
ALL_MESSAGES.slice(
i * MAX_MESSAGE_COUNT_EVERY_SESSION,
i * MAX_MESSAGE_COUNT_EVERY_SESSION + MAX_MESSAGE_COUNT_EVERY_SESSION,
).map(item => [item.mid, item]),
),
]),
),
};
Ready to run.
Test | Ops/sec | |
---|---|---|
1 |
| ready |
2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.