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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0
Browser:
Chrome 147
Operating system:
Windows
Device Platform:
Desktop
Date tested:
15 days ago
Test name
Executions per second
Spread
3298.2 Ops/sec
use lodash
3293.6 Ops/sec
Array.from
3237.9 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) );