Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
fromEntriesVSReduce
(version: 1)
Comparing performance of:
fromEntries vs Reduce
Created:
one month ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
fromEntries
Object.fromEntries( [ "string 1", "string 2", "string 3", "string 4", "string 5", ].map((key) => [ key, { data: "data", code: 200, }, ]), )
Reduce
[ "string 1", "string 2", "string 3", "string 4", "string 5", ].reduce( (acc, key) => ({ ...acc, [key]: { data: "data" , code: 200, }, }), {}, )
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
fromEntries
Reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Android 16; Mobile; rv:150.0) Gecko/150.0 Firefox/150.0
Browser/OS:
Firefox Mobile 150 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
fromEntries
5418892.0 Ops/sec
Reduce
2703148.8 Ops/sec
Related benchmarks:
reate array by lenght
Nullish vs If
Splti vs Trim vs replace className
Test direct and destructuring performances
comparing array creation
Object vs Map MYTEST2137
sample normal vs Object.freeze vs Object.seal performance
String comp
FormData conversion: Object.fromEntries vs for loop
Comments
Confirm delete:
Do you really want to delete benchmark?