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 largeArray = Array.from({ length: 1e6 }).map(() => ({ key: "value" }));
const simpleObject = {"key1": "value"};
const simpleValues = {
num: 1,
bool: true,
string: "string",
null: null,
undefined: undefined
};
const complexValues = {
array: [1, 2, 3, 4, 5],
object: { key: "value" },
date: new Date(),
}
const simpleArray = [1, 2, 3, 4, 5];
// [[1,2,3,4,[[1,2,3,4,[1,2,3,4,5]],...],...]
const deepArray = Array.from({ length: 25 }).map(() => [1, 2, 3, 4, Array.from({ length: 25 }).map(() => [1, 2, 3, 4, Array.from({ length: 25 }).map(() => [1, 2, 3, 4, 5])])]);
// {key0: {num: 1, bool: true, string: "string", null: null, undefined: undefined, deep: {array: ...}}, key1: {...}, ...}
const deepObject = Array.from({ length: 25 }).reduce((acc, _, i) => {
acc[`key${i}`] = { ...simpleObject, deep: { ...complexValues, deep: { ...simpleObject } } };
return acc;
}, {});
Ready to run.
Test | Ops/sec | |
---|---|---|
structuredClone simple object values |
| ready |
structuredClone complex object values |
| ready |
structuredClone simple array |
| ready |
structuredClone deep array |
| ready |
structuredClone large array |
| ready |
structuredClone deep object |
| ready |
JSON copy simple object values |
| ready |
JSON copy complex object values |
| ready |
JSON copy simple array |
| ready |
JSON copy deep array |
| ready |
JSON copy large array |
| ready |
JSON copy deep object |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.