Tests:
  • none

    x
     
    const n = 100;
    function getRandomInt(max) {
        return Math.floor(Math.random() * max);
    }
    const arr = [];
    for(let i = 0; i < n; ++i) {
      arr.push(getRandomInt(1000))
    }
  • new

     
    const n = 100;
    function getRandomInt(max) {
        return Math.floor(Math.random() * max);
    }
    const arrPre = new Array(n);
    for(let i = 0; i < n; ++i) {
      arrPre[i] = getRandomInt(1000)
    }
  • length

     
    const n = 100;
    function getRandomInt(max) {
        return Math.floor(Math.random() * max);
    }
    const arrLen = []; arrLen.length = n;
    for(let i = 0; i < n; ++i) {
      arrLen[i] = getRandomInt(1000)
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    none
    new
    length

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36
Chrome Mobile 106 on Android
View result in a separate tab
Test name Executions per second
none 16627.1 Ops/sec
new 16091.1 Ops/sec
length 16935.1 Ops/sec