Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash unionWith vs Set for merging without duplicates
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 129
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Set
1553505.4 Ops/sec
unionWith
63532.3 Ops/sec
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Tests:
Set
const first = [ {a: 3, b: 3, c: "hey"}, {a: 3, b: 2, c: "hey"}, {a: 1, b: 2, c: "bye"}, {a: 3, b: 4, c: "hey"}, {a: 2, b: 1, c: "bye"} ]; const second = [ {a: 3, b: 4, c: "hey"}, {a: 2, b: 1, c: "bye"}, {a: 4, b: 4, c: "sup"}, {a: 3, b: 3, c: "hey"} ]; return [...new Set([...first, ...second])]
unionWith
const first = [ {a: 3, b: 3, c: "hey"}, {a: 3, b: 2, c: "hey"}, {a: 1, b: 2, c: "bye"}, {a: 3, b: 4, c: "hey"}, {a: 2, b: 1, c: "bye"} ]; const second = [ {a: 3, b: 4, c: "hey"}, {a: 2, b: 1, c: "bye"}, {a: 4, b: 4, c: "sup"}, {a: 3, b: 3, c: "hey"} ]; return _.unionWith(first, second, _.isEqual);