Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Deep merge lodash vs ramda vs deepmerge vs es-toolkit
(version: 0)
Comparing performance of:
Ramda.mergeDeepRight vs Lodash.merge vs deepmerge vs es-toolkit merge
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/es-toolkit/dist/browser.global.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/lodash.merge/index.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/ramda/dist/ramda.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/deepmerge/dist/umd.min.js"></script>
Script Preparation code:
var obj1 = [ { "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" }, { "id": "1003", "type": "Blueberry" }, { "id": "1004", "type": "Devil's Food" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5007", "type": "Powdered Sugar" }, { "id": "5006", "type": "Chocolate with Sprinkles" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] }, { "id": "0002", "type": "donut", "name": "Raised", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] }, { "id": "0003", "type": "donut", "name": "Old Fashioned", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] } ] var obj2 = [ { "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Overwritten" }, { "id": "1002", "type": "Chocolate" }, { "id": "1003", "type": "Overwritten" }, { "id": "1004", "type": "Devil's Food" } ] }, "topping": [ { "id": "5001", "type": "Overwritten" }, { "id": "5002", "type": "Overwritten" }, { "id": "5005", "type": "Sugar" }, { "id": "5007", "type": "Powdered Sugar" }, { "id": "5006", "type": "Chocolate with Sprinkles" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Overwritten" } ] }, { "id": "0002", "type": "Overwritten", "name": "Raised", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Overwritten" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Overwritten" }, { "id": "5005", "type": "Sugar" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] }, { "id": "0003", "type": "Overwritten", "name": "Old Fashioned", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Overwritten" }, { "id": "1002", "type": "Chocolate" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] } ]
Tests:
Ramda.mergeDeepRight
R.mergeDeepRight(obj1, obj2)
Lodash.merge
merge(obj1, obj2)
deepmerge
deepmerge(obj1, obj2)
es-toolkit merge
_.merge(obj1, obj2)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Ramda.mergeDeepRight
Lodash.merge
deepmerge
es-toolkit merge
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Browser/OS:
Chrome 145 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Ramda.mergeDeepRight
622625.1 Ops/sec
Lodash.merge
154208.3 Ops/sec
deepmerge
106216.4 Ops/sec
es-toolkit merge
164121.5 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It looks like we have a JSON object and some benchmark results to work with. The JSON object appears to be a JavaScript function call, specifically `R.mergeDeepRight(obj1, obj2)`, where `obj1` and `obj2` are objects being merged. The JSON object is: ```json { "id": "5002", "type": "Overwritten" }, { "id": "5005", "type": "Sugar" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] ``` And the benchmark results are: ```json [ { "RawUAString": "...", "Browser": "Chrome 127", "DevicePlatform": "Desktop", "OperatingSystem": "Windows", "ExecutionsPerSecond": 281012.25, "TestName": "Ramda.mergeDeepRight" }, { "RawUAString": "...", "Browser": "Chrome 127", "DevicePlatform": "Desktop", "OperatingSystem": "Windows", "ExecutionsPerSecond": 145272.125, "TestName": "es-toolkit merge" }, { "RawUAString": "...", "Browser": "Chrome 127", "DevicePlatform": "Desktop", "OperatingSystem": "Windows", "ExecutionsPerSecond": 45478.65625, "TestName": "Lodash.merge" }, { "RawUAString": "...", "Browser": "Chrome 127", "DevicePlatform": "Desktop", "OperatingSystem": "Windows", "ExecutionsPerSecond": 29445.7265625, "TestName": "deepmerge" } ] ``` My analysis: * The JSON object appears to be an empty list of objects, with each object having a unique `id` and a `type`. * The benchmark results show the performance of different libraries (Ramda, Lodash, es-toolkit, and deepmerge) on a Chrome browser running on Windows. * Ramda's `R.mergeDeepRight(obj1, obj2)` is the fastest, followed by es-toolkit's `_.merge()`, then Lodash's `L.merge()`. Based on this analysis, I'll provide an answer that: 1. Verifies the JSON object and benchmark results are valid. 2. Provides a comparison of the performance of different libraries based on the benchmark results. Here is my final answer: **Verification**: The JSON object is a valid JavaScript expression representing two objects being merged. The benchmark results are also valid, showing the performance of each library on a Chrome browser running on Windows. **Comparison**: | Library | Executions/Sec | | --- | --- | | Ramda | 281012.25 | | es-toolkit | 145272.125 | | Lodash | 45478.65625 | | deepmerge | 29445.7265625 | Based on these results, Ramda's `R.mergeDeepRight(obj1, obj2)` is the fastest library, followed by es-toolkit's `_.merge()`, then Lodash's `L.merge()`. Please let me know if this answer meets your requirements!
Related benchmarks:
Deep merge lodash vs ramda vs deepmerge vs json clone
Deep merge lodash 4.6.2 vs ramda vs deepmerge
Deep merge lodash vs ramda vs deepmerge !
Deep merge lodash vs ramda vs deepmerge vs json clone 3
Object Cloning Comparsion
Comments
Confirm delete:
Do you really want to delete benchmark?