Run details:
Mozilla/5.0 (Linux; Android 12; 2201123G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.167 Mobile Safari/537.36 OPR/77.5.4095.75179
Opera Mobile 77
Android
Mobile
one year ago
Test name Executions per second
Set 1499859.8 Ops/sec
Array 2622620.2 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);