Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash vs map replacer
(version: 3)
Comparing performance of:
Lodash set vs Map vs Direct Property Access
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
var person = [{name: 'Frederick', lastName: 'Corcino Alejo', foo: { bar: "baz" } }];
Tests:
Lodash set
_.set(person, '[0].foo.bar', 'saz');
Map
person = person.map(p => ({ ...p, foo: { ...p.foo, bar: "saz" } }));
Direct Property Access
person[0].foo.bar="saz"
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Lodash set
Map
Direct Property Access
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/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash set
8108963.5 Ops/sec
Map
9183553.0 Ops/sec
Direct Property Access
132070392.0 Ops/sec
Related benchmarks:
Map lodash and PureJS
A native map vs lodash _.map
find by id and replace in array [lodash vs js vs ramda]
lodash each vs loop on objects
lodash each vs loop over entries on objects
Lodash.set vs direct access
testtest9897
Lodash.get vs native with optional chaining
Lodash isEqual vs native JS === for strings
Comments
Confirm delete:
Do you really want to delete benchmark?