Tests:
  • Preallocate

    AخA
     
    var N = 10000;
    var result = new Array(N);
    for (var i = 0; i < N; i++) {
      result[i] = {n: N};
    }
  • Push

     
    var N = 10000;
    var result = [];
    for (var i = 0; i < N; i++) {
      result.push({n: N});
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Preallocate
    Push

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Firefox 136 on Windows
View result in a separate tab
Test name Executions per second
Preallocate 5495.9 Ops/sec
Push 6753.1 Ops/sec