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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69 on Linux
View result in a separate tab
Test name Executions per second
Lodash Uniq 3.1 Ops/sec
Javascript Set 2.7 Ops/sec