Script Preparation code:
AخA
 
const array = Array.from({length: 10_000}, () => Math.floor(Math.random() * 10_000_000))
Tests:
  • Array.push + Array.reverse

     
    const temp = [];
    array.forEach(x => temp.push(x));
    return temp.reverse();
  • Array.unshift

     
    const temp = [];
    array.forEach(x => temp.unshift(x));
    return temp;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.push + Array.reverse
    Array.unshift

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 days ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/136.2 Mobile/15E148 Safari/605.1.15
Mobile Safari 18 on iOS 18.3.2
View result in a separate tab
Test name Executions per second
Array.push + Array.reverse 26669.9 Ops/sec
Array.unshift 97.0 Ops/sec