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:
7 months ago
by:
Guest
Go 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:
7 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
reduce
3K/s
object.fromEntries+map
973/s
View exact numbers
Test name
Executions per second
✓
reduce
3,064 Ops/sec
object.fromEntries+map
973 Ops/sec
Related benchmarks
reduce vs map + fromEntries
reducer vs fromEntries
reduce object vs object.fromentries (1K records)
Comments
Confirm delete:
Do you really want to delete benchmark?