Script Preparation code:
  • `Array.slice(0, N)`

  • `Array.length = N`

  • `Object.assign([], arr)` with `Array.length = N`

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    `Array.slice(0, N)`
    `Array.length = N`
    `Object.assign([], arr)` with `Array.length = N`

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 24 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36
Chrome 126 on Windows
View result in a separate tab
Test name Executions per second
`Array.slice(0, N)` 14201890.0 Ops/sec
`Array.length = N` 10926810.0 Ops/sec
`Object.assign([], arr)` with `Array.length = N` 283612.8 Ops/sec