Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash uniq vs new Set with spread to array
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
lodash uniq
4709911.5 Ops/sec
new Set with spread
2339754.2 Ops/sec
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Tests:
lodash uniq
const array = [1, 2, 3, 4, 5, 4, 3, 1, 6, 7, 7, 4, 8, 9, 2, 3, 4, 5, 1, 9, 5, 7, 2, 1]; return _.uniq(array);
new Set with spread
const array = [1, 2, 3, 4, 5, 4, 3, 1, 6, 7, 7, 4, 8, 9, 2, 3, 4, 5, 1, 9, 5, 7, 2, 1]; return [...new Set(array)];