Tests:
  • with if-check

    x
     
    let updates = [5, 23, 42]
    const removedItems = []
    if (removedItems.length) {
      updates = updates.filter((id) => !removedItems.includes(id));
    }
  • without if-check

     
    const removedItems = []
    const updates = [5, 23, 42].filter((id) => !removedItems.includes(id));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    with if-check
    without if-check

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Chrome 83 on Linux
View result in a separate tab
Test name Executions per second
with if-check 223021536.0 Ops/sec
without if-check 35709120.0 Ops/sec