Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash Uniq vs ES6 set and sort
(version: 1)
Benchmarking joining 2 arrays, removing the duplicates and sorting the,
Comparing performance of:
Lodash uniq vs ES6 Set and sort
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
const array1 = [ "hijkl", "abc", "mn", "opqrs", "defg", "tuv", "wxy", "zab", "cde", "fghij", "klmno", "pqrst", "uvwxy", "zabcd", "efghi" ]; const array2 = [ "defg", "abc", "hijkl", "mn", "opqrs", "tuv", "wxy", "zab", "cde", "fghij", "klmno", "pqrst", "uvwxy", "zabcd", "efghi", "jklmn", "opqrs", "tuvwx", "yzabc", "defgh" ];
Tests:
Lodash uniq
return _.uniq(...array1, ...array2);
ES6 Set and sort
return [...new Set(array1, array2)].sort();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash uniq
ES6 Set and sort
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser/OS:
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash uniq
4720524.5 Ops/sec
ES6 Set and sort
1522144.0 Ops/sec
Related benchmarks:
string array sort comparison
string array sort comparison 2
string array sort comparison 3
Array join and let unique values in return v2
has vs includes vs indexOf
has vs includes vs indexOf 10k records
Array.sort vs Math.min+Math.max with strings
Lodash uniq vs ES6 Set and sort with 2 arrays
Lodash 4 uniq vs ES6 Set and sort
Comments
Confirm delete:
Do you really want to delete benchmark?