Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
map iteration benchmark
(version: 1)
Comparing performance of:
object fromentries vs reduce
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const map = new Map(); [...new Array(100000).keys()].forEach((i) => { map.set(i.toString(), i.toString()) })
Tests:
object fromentries
Object.fromEntries(map.entries())
reduce
const obj = {} map.forEach((value, key) => { obj[key] = value })
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
object fromentries
reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser/OS:
Chrome 134 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
object fromentries
103.7 Ops/sec
reduce
504.4 Ops/sec
Related benchmarks:
Array vs Map vs object iteration 2
iterate over array
Object vs Map creation (forEach, reduce)
Reduce vs Map+FromEntries vs for loop vs forEach
Iterate keys Object vs Map
testestets 2
Map() vs Object() on write no strings
Reduce vs Map+FromEntries vs for loop vs forof loop
Reduce vs Map+FromEntries vs for loop vs forof loop vd
Comments
Confirm delete:
Do you really want to delete benchmark?