HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.5/lodash.min.js"></script>
Script Preparation code:
x
 
var firstEqual = Array.from({length: 1000000}, (item, idx) => idx);
var secondEqual = Array.from({length: 1000000}, (item, idx) => idx);
var arrayToDedup = firstEqual.concat(secondEqual);
Tests:
  • Lodash Uniq

     
    _.uniq(arrayToDedup);
  • Javascript Set Iterator

     
    [...new Set(arrayToDedup)]
  • Javascript Set Array.from

     
    Array.from(new Set(arrayToDedup))
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash Uniq
    Javascript Set Iterator
    Javascript Set Array.from

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Lodash Uniq 7.3 Ops/sec
Javascript Set Iterator 8.3 Ops/sec
Javascript Set Array.from 8.4 Ops/sec