Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Object.fromEntries vs mapValues
(version: 1)
Comparing performance of:
fromEntries vs mapValues
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here--> <script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js'></script>
Script Preparation code:
var data = { ...Array.from(Array(10000).keys()) };
Tests:
fromEntries
Object.fromEntries( Object.entries(data).map( ([key, value]) => ([key, {...value, test: value + 1 }]) ) )
mapValues
_.mapValues(data, (value) => ({ ...value, test: value + 1 }))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
fromEntries
mapValues
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser/OS:
Chrome 135 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
fromEntries
1617.8 Ops/sec
mapValues
3717.6 Ops/sec
Related benchmarks:
lodash.each vs Object.forEach
lodash map vs Object.keys map
lodash map vs Object.keys map
Testy Test
Ramda vs lodash vs native map
lodash map vs Object.values map
array iteration vs _.map vs map
lodash map vs Object.keys map vs Object.values
delwar lodash vs native 2
Comments
Confirm delete:
Do you really want to delete benchmark?