Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Object.fromEntries vs reduce object.assign
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser:
Firefox 138
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Reduce (object assign)
197/s
Object.fromEntries
183/s
Reduce (creating temporary objects)
0/s
View exact numbers
Test name
Executions per second
✓
Reduce (object assign)
197 Ops/sec
Object.fromEntries
183 Ops/sec
Reduce (creating temporary objects)
0 Ops/sec
Script Preparation code:
var data = { ...Array.from(Array(10000).keys()) };
Tests:
Object.fromEntries
Object.fromEntries(Object.entries(data).map((key, value) => [key, value]));
Reduce (object assign)
Object.entries(data).reduce((object, [key, value]) => Object.assign(object, { [key]: value }), {})
Reduce (creating temporary objects)
Object.entries(data).reduce((acc, [k, v]) => ({ ...acc, [k]: v.toString() }), {});