Run details:
Mozilla/5.0 (Android 7.1.2; Mobile; rv:88.0) Gecko/88.0 Firefox/88.0
Firefox Mobile 88
Android 7.1.2
Mobile
3 years ago
Test name Executions per second
Set 140130.2 Ops/sec
Array 416339.3 Ops/sec
HTML Preparation code:
x
 
1
2
<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]);
    return l;
  • Array

     
    var l = [1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
    return _.uniq(l);