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 = [];
var secondEqual = [];
for (var i=0; i<=1000000; i++) {
  firstEqual.push(i);
  secondEqual.push(i);
}
var arrayToDedup = [...firstEqual, ...secondEqual];
Tests:
  • Lodash Uniq

     
    _.uniq(arrayToDedup);
  • Javascript Set

     
    [...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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Chrome 70 on Windows
View result in a separate tab
Test name Executions per second
Lodash Uniq 2.0 Ops/sec
Javascript Set 1.9 Ops/sec