HTML Preparation code:
x
 
1
2
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Script Preparation code:
 
var arr = [5,1,3,7,9,2,11];
var mySet = new Set(arr);
Tests:
  • set

     
    mySet.add(12);
    mySet.add(12);
    mySet.add(5);
    mySet.add(17);
    mySet.add(1);
    mySet.add(11);
    return arr;
  • uniq

     
    arr = _.uniq(arr.push(12));
    arr = _.uniq(arr.push(12));
    arr = _.uniq(arr.push(5));
    arr = _.uniq(arr.push(17));
    arr = _.uniq(arr.push(1));
    arr = _.uniq(arr.push(12));
    return arr;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    set
    uniq

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0
Firefox 94 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
set 6824063.0 Ops/sec
uniq 7982080.5 Ops/sec