Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash uniq vs Array.from(new Set()) vs spread new Set() [big arrays 2]
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/122.0.0.0 Safari/537.36
Browser:
Chrome 122
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Spread
7119.0 Ops/sec
use lodash
7033.0 Ops/sec
Array.from
6968.2 Ops/sec
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Script Preparation code:
var arr = new Array(10_000).fill(1).map(() => Math.round(Math.random() * 20))
Tests:
Spread
return [...new Set(arr)]
use lodash
return _.uniq(arr);
Array.from
return Array.from( new Set(arr) );