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
Go 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
mapValues
4K/s
fromEntries
2K/s
View exact numbers
Test name
Executions per second
✓
mapValues
3,718 Ops/sec
fromEntries
1,618 Ops/sec
Related benchmarks
lodash.each vs Object.forEach
lodash map vs Object.values map
Comments
Confirm delete:
Do you really want to delete benchmark?