Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
reduce vs object entries
(version: 1)
Comparing performance of:
reduce vs object.fromEntries+map
Created:
4 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const list = Array.from({ length: 10000 }, (_, i) => `cenas_${i}`);
Tests:
reduce
const tranformedArr = list.reduce((acc, value) => { acc[value] = true; return acc; }, {});
object.fromEntries+map
const tranformedArr = Object.fromEntries(new Map(list.map((value) => [value, true])),);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
reduce
object.fromEntries+map
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser/OS:
Chrome 143 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
reduce
3063.7 Ops/sec
object.fromEntries+map
972.7 Ops/sec
Related benchmarks:
reduce vs map + fromEntries
Object.fromEntries vs reduce vs Map + Array.from
reduce with and without spread syntax
Object.fromEntries vs reduce v3
reduce vs map + fromEntries vs reduce + Map
reduce vs map + fromEntries (2)
Object.fromEntries vs reduce - no map - small array
reducer vs fromEntries
reduce object vs object.fromentries (1K records)
Comments
Confirm delete:
Do you really want to delete benchmark?