Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
lodash uniq vs Array.from(new Set()) vs spread new Set() v3 strings
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Browser:
Firefox 129
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
use lodash
4K/s
Array.from
4K/s
Spread
4K/s
just set
4K/s
View exact numbers
Test name
Executions per second
✓
use lodash
4,341 Ops/sec
Array.from
4,339 Ops/sec
Spread
4,087 Ops/sec
just set
4,059 Ops/sec
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script> <script> const arr = (new Array(10000)).fill().map(e => "asd" + String.fromCharCode(Math.floor(97 + Math.random() * 25))); </script>
Tests:
Spread
return [...new Set(arr)]
use lodash
return _.uniq(arr);
Array.from
return Array.from( new Set(arr) );
just set
new Set(arr)