This benchmark compares the performance of lodash's `union` function with native JavaScript code for creating an array of unique values from all given arrays. The lodash `union` function creates an array of unique values, in order, from all given arrays. The native JavaScript code uses the `Array.prototype.concat()` method combined with `new Set()` to achieve the same result.
Comparing performance of: lodash.union vs Native JavaScript
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
lodash.union
Native JavaScript
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15