Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash "uniqWith" "uniqBy" "unionWith" "unionBy"
(version: 0)
Comparing performance of:
uniqWith vs uniqBy vs UnionWith vs unionBy
Created:
3 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js'></script>
Script Preparation code:
var users = [ { 'name': 'barney', 'age': 36 }, { 'name': 'pebbles', 'age': 5 } ]; var newUsers = [ { 'name': 'fred', 'age': 40 }, { 'name': 'barney', 'age': 36 }, { 'name': 'pebbles', 'age': 2 } ]; for(let i = 0; i < 2000; i++) { var newUser = { 'name': 'user_' + i, 'age': Math.floor(Math.random() * i) }; newUsers.push(newUser); }
Tests:
uniqWith
const unionUsers1 = _.uniqWith(newUsers.concat(users), _.isEqual);
uniqBy
const unionUsers2 = _.uniqBy(newUsers.concat(users), 'name');
UnionWith
const unionUsers3 = _.unionWith(newUsers, users, _.isEqual);
unionBy
const unionUsers4 = _.unionBy(newUsers, users, 'name');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
uniqWith
uniqBy
UnionWith
unionBy
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!
Related benchmarks:
Lodash "unionWith" "unionBy" "uniqWith" 5
Lodash "unionWith" "unionBy" "uniqBy" 5
Lodash "uniqWith" "unionBy" "uniqBy" 6
Lodash "uniqWith" "unionBy" "uniqBy" 27062023
Lodash "uniqWith" "unionBy" "uniqBy" 8
Comments
Confirm delete:
Do you really want to delete benchmark?