Script Preparation code:
AخA
 
const n = 10000
var arr = new Array(n).fill(0);
for (let i = 0; i < n; i++) {
  arr[i] = i;
}
Tests:
  • Dynamic Creation

     
    const result = [];
    for (let i = 0; i < arr.length; i++) {
      result.push({
        x: arr[i],
        y: arr[i] + 1
      });
    }
  • Pooling

     
    const result = [];
    const obj = { x: 0, y: 0 };
    for (let i = 0; i < arr.length; i++) {
      obj.x = arr[i];
      obj.y = arr[i] + 1;
      result.push(obj);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Dynamic Creation
    Pooling

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Linux
View result in a separate tab
Test name Executions per second
Dynamic Creation 6140.5 Ops/sec
Pooling 11826.9 Ops/sec