Script Preparation code:
AخA
 
var input = [];
for (var i = 0; i < 50000; i++) {
    input.push({
        id: i,
        data: 'something'
    })
}
Tests:
  • Array splice

     
    const index = input.findIndex(val => val.id === 999);
    input.splice(index, 1);
  • Object re assign

     
    var input = [];
    for (var i = 0; i < 49999; i++) {
        input.push({
            id: i,
            data: 'something'
        })
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array splice
    Object re assign

    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.110 Safari/537.36
Chrome 96 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array splice 1808.5 Ops/sec
Object re assign 1451.2 Ops/sec