Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash union VS ES6 Set
(version: 0)
Comparing performance of:
ES6 SET vs Lodash union
Created:
4 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js'></script>
Tests:
ES6 SET
const ids_a=[138782,146208,146210,146212,146213,146214,146215,146513,146515,146911,148275,148300,148309,148310,148321,138782,146208,146210,146212,146213,146214,146215,148275,148300,148309,148310,148321,146513,146515,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146513,146515,148300,148310,146208,146213,148275,146210,146214,146911,148309,146212,146215,148321,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146911,138782,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146212,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146213,146214,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146212,146213,146214,146215,146215,146911,146911,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,138782,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146213,146214,146215,146911,146911,146911,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911]; const ids_b=[1,146208,2,146212,3,146214,4,146513,5,146911,6,148300,148309,148310,148321,138782,146208,146210,146212,146213,146214,146215,148275,148300,148309,148310,148321,146513,146515,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146513,146515,148300,148310,146208,146213,148275,146210,146214,146911,148309,146212,146215,148321,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146911,138782,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146212,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146213,146214,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146212,146213,146214,146215,146215,146911,146911,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,138782,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146213,146214,146215,146911,146911,146911,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911]; const result = [...new Set([...ids_a,...ids_b])]
Lodash union
const ids_a=[138782,146208,146210,146212,146213,146214,146215,146513,146515,146911,148275,148300,148309,148310,148321,138782,146208,146210,146212,146213,146214,146215,148275,148300,148309,148310,148321,146513,146515,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146513,146515,148300,148310,146208,146213,148275,146210,146214,146911,148309,146212,146215,148321,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146911,138782,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146212,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146213,146214,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146212,146213,146214,146215,146215,146911,146911,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,138782,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146213,146214,146215,146911,146911,146911,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911]; const ids_b=[1,146208,2,146212,3,146214,4,146513,5,146911,6,148300,148309,148310,148321,138782,146208,146210,146212,146213,146214,146215,148275,148300,148309,148310,148321,146513,146515,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146513,146515,148300,148310,146208,146213,148275,146210,146214,146911,148309,146212,146215,148321,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146911,138782,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,138782,146212,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146213,146214,146911,146208,146210,146212,146213,146214,146215,148275,148309,148321,146212,146213,146214,146215,146215,146911,146911,138782,146208,146210,146212,146213,146214,146215,148275,148309,148321,138782,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146213,146214,146215,146911,146911,146911,138782,146208,146213,148275,146210,146214,146911,148309,146212,148321,146215,138782,146911,138782,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,138782,146911,146208,146210,146212,146213,146214,146215,146911,148275,148309,148321,146208,146210,146212,146213,146214,146215,148275,148309,148321,146911]; const result = _.union(ids_a,ids_b)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
ES6 SET
Lodash union
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Based on the provided benchmark results, it appears that the Lodash `union` function is faster than the ES6 `Set` data structure. The difference in executions per second between the two tests is significant: * ES6 SET: 92880.4140625 executions/second * Lodash union: 99001.5859375 executions/second This suggests that the Lodash `union` function is more efficient than the ES6 `Set` data structure, likely due to the optimized implementation of the Lodash library. However, it's worth noting that this result may vary depending on the specific use case and input data. The benchmark results provided are for a specific test scenario, and the actual performance may differ in other situations. Therefore, the answer is: The Lodash `union` function is faster than the ES6 `Set` data structure.
Related benchmarks:
_.union vs native Set() implementation
Lodash union vs native Set() implementation
Array immutable union: lodash union vs flatten and creating a new set
Lodash Chain vs Native (with &&) vs Native (without &&) vs Flow, with actual filtering
Lodash union vs Native Javascript
Comments
Confirm delete:
Do you really want to delete benchmark?