Tests:
  • Preallocate typed

    AخA
     
    var N = 10000;
    var result = new Uint8Array(N);
    for (var i = 0; i < N; i++) {
      result[i] = i;
    }
  • Preallocate vanilla

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

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Preallocate typed
    Preallocate vanilla

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Firefox 133 on Windows
View result in a separate tab
Test name Executions per second
Preallocate typed 326690.3 Ops/sec
Preallocate vanilla 52909.0 Ops/sec