Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash uniq vs set spread
is it faster to use spread notation and a new Set or is it faster to use lodash uniq?
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0 r3dfox/139.0.4
Browser:
Firefox 139
Operating system:
Windows 8.1
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
Set
59895.9 Ops/sec
Array
61548.6 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 = [...Array(50).keys()].flatMap(a => [...Array(20).keys()])
Tests:
Set
var l = [...new Set(arr)]; return l;
Array
var l = arr; return _.uniq(l);