Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash 4 uniq vs ES6 Set and sort
Benchmarking uniq vs using a set and sort it. 2 arrays to an array with removed duplicates and sorted
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0
Browser:
Firefox 130
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
lodash uniq
4435441.0 Ops/sec
ES6 Set and sort
655610.5 Ops/sec
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();