Script Preparation code:
AخA
 
var x = [];
for (let i = 0; i < 1000; ++i) {
    x.push({
        v: Math.floor(Math.random() * 1000)
    });
}
Tests:
  • Sort and Shift

     
    x.sort((a, b) => { return a.v - b.v });
    let y = x.shift();
  • Loop and Splice

     
    let b = 0;
    for (const a in x) {
      if (x[a].v < x[b].v) {
        b = a;
      }
    }
    let y = x.splice(b, 1);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Sort and Shift
    Loop and Splice

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128 on Windows
View result in a separate tab
Test name Executions per second
Sort and Shift 78589232.0 Ops/sec
Loop and Splice 31055986.0 Ops/sec