HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Tests:
  • lodash union

     
    var a = [ 'a', 'b', 'c', 'b', 'd', 'a', 'e', 'f' ];
    var b = [ 'b', 'd', 'a', 'e', 'f' ];
    var c = _.union(a);
  • lodash uniq spread

     
    var a = [ 'a', 'b', 'c', 'b', 'd', 'a', 'e', 'f' ];
    var b = [ 'b', 'd', 'a', 'e', 'f' ];
    var c = _.uniq(a);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash union
    lodash uniq spread

    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_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36
Chrome 96 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
lodash union 4441646.5 Ops/sec
lodash uniq spread 6909376.0 Ops/sec