Script Preparation code:
AخA
 
var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
Tests:
  • Array Slice

     
    var copy = data.slice(0, 4);
  • Direct Attribution

     
    var copy = [];
    for (var i = 0; i < 5; i++) {
      copy[i] = data[i];
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array Slice
    Direct Attribution

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114 on Windows
View result in a separate tab
Test name Executions per second
Array Slice 25147844.0 Ops/sec
Direct Attribution 6077429.0 Ops/sec