Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.fromEntries - 50 items
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Browser:
Chrome 127
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
1
1629382.5 Ops/sec
2
394486.9 Ops/sec
3
1578177.8 Ops/sec
4
238371.7 Ops/sec
Script Preparation code:
var list = Array.from(Array(50), (x,i) => [i,i]);
Tests:
1
const obj = {}; for (const item of list) { obj[item[0]] = item[1]; }
2
const obj = Object.fromEntries(list);
3
const obj = list.reduce((result, item) => { result[item[0]] = item[1]; return result; }, {})
4
const obj = list.reduce((result, item) => ({ ...result, [item[0]]: item[1], }), {})