HTML Preparation code:
x
 
1
2
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
 
var a = _.range(0, 1000).map(i => ({a: {id: i}}))
var b = [...a]
b[500] = ({a: {id: 500}})
Tests:
  • diff

     
    console.log(_.difference(a, b))
  • b

     
    console.log(_.difference(a, b))
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    diff
    b

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Chrome 79 on Linux
View result in a separate tab
Test name Executions per second
diff 7564.0 Ops/sec
b 7622.2 Ops/sec