Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array of strings, null, and ints lodash uniq vs set
What is the fastest method of getting a the unique items from an array
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0
Browser:
Firefox 141
Operating system:
Linux
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
Set
2076646.0 Ops/sec
uniq
1126943.1 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 = ['Batman', 'Dr. Doom', null, 'Iron Man', 'Rorschach', 'Captain America', 'J. Jonah Jameson', 'The Mekon', null, '', null, '', 'Scott Pilgrim', 'Batman', 'Dr. Doom', 'Iron Man', 'Rorschach', 'Captain America', 'J. Jonah Jameson', 'The Mekon', 'Scott Pilgrim', 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
Tests:
Set
var u = new Set(arr); return u;
uniq
var u = _.uniq(arr) return u;