Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
uniq indexOf vs lodash uniq
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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
ld uniq
61.6 Ops/sec
index of
33.6 Ops/sec
set
58.4 Ops/sec
Script Preparation code:
var unique = (value, index, self) => { return self.indexOf(value) === index; }; var items = []; for (i = 0; i < 1000000; i++) { items.push(Math.floor(Math.random() * 100)); }
Tests:
ld uniq
_.uniq(items)
index of
items.filter(unique);
set
[...new Set(items)];