Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash uniq vs set 100k elements
(version: 1)
Comparing performance of:
Set vs Array
Created:
one year ago
by:
Guest
Go to the latest result
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Tests:
Set
var l = new Set([1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]); for (let i = 0; i < 100000; i++) { l.add(i%52); } return l;
Array
var l = [1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]; for (let i = 0; i < 100000; i++) { l.push(i%52); } return _.uniq(l);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Set
Array
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser/OS:
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Set
2K/s
Array
1K/s
View exact numbers
Test name
Executions per second
✓
Set
1,956 Ops/sec
Array
1,255 Ops/sec
Related benchmarks
lodash uniq vs set
lodash uniq vs set vs indexof
lodash uniq vs set arossert
uniq vs lodash vs set
lodash uniq vs set (fork 12)
Comments
Confirm delete:
Do you really want to delete benchmark?