Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Reduce vs FromEntries vs for loop
(version: 0)
Comparing performance of:
reduce vs fromEntries vs for loop
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var data = Object.entries(Array.from(Array(10000).keys()));
Tests:
reduce
data.reduce((acc, [k, v]) => { acc[k] = v; return acc; }, {});
fromEntries
Object.fromEntries(data);
for loop
const dataObject = data const acc = {} for (let i = 0; i < dataObject.length; i++) { acc[dataObject[i][0]] = dataObject[i][1] }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
reduce
fromEntries
for loop
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?