HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash/lodash.min.js"></script>
Script Preparation code:
x
 
var firstEqual = [];
var secondEqual = [];
for (var i=0; i<=10000; 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: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
Chrome 89 on Windows
View result in a separate tab
Test name Executions per second
Lodash Uniq 651.4 Ops/sec
Javascript Set 718.8 Ops/sec