Script Preparation code:
AخA
 
window.top.tests = {control:[], concat:[], spread:[]};
window.test = (new Array(10)).fill(null);
window.cutoff = 5000;
Tests:
  • Control (for push)

    x
     
    for (let element of window.test) window.top.tests.control.push(element);
  • Concat

     
    window.top.tests.concat = window.top.tests.concat.concat(window.test);
  • Spread

     
    window.top.tests.spread.push(...window.test);
  • Spread 2

     
    window.top.tests.spread = [window.top.tests.spread, ...window.test];
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Control (for push)
    Concat
    Spread
    Spread 2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Chrome 133 on Windows
View result in a separate tab
Test name Executions per second
Control (for push) 414745.2 Ops/sec
Concat 744.3 Ops/sec
Spread 1555968.0 Ops/sec
Spread 2 53699.5 Ops/sec