Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Checkboxes table OBJECT VS ARRAY
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
OBJECT
1606.5 Ops/sec
ARRAY
2261.5 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
let array = []; for (let i = 0; i < 100; i++) { array.push({ id: i+1 }) } let obj = array.reduce((acc, item) => ({ ...acc, [item]: 'dataObj' }), {});
Tests:
OBJECT
let items = obj; for (let i = 0; i < 100; i++) { items = obj; const newItems = { ...items, 5050: 'newDataObj' } const copyItems = { ...items } delete copyItems['5050'] items = []; }
ARRAY
let items = array; for (let i = 0; i < 100; i++) { items = array; const index = items.findIndex((item) => item.id === 5050) || null; if (index) { items[index] = 5050 } else { items.push({ id: 5050 }) } items.filter((item) => item.id !== 5050) items = []; }