Script Preparation code:
AخA
 
t=new Array(500000);
for (let i=0;i<t.length;i++) {t[i]=Math.random();}
Tests:
  • reduce

     
    t.reduce((p,c) => p+c, 0);
  • loop

    x
     
    (() => {
      let i = 0, res = 0, l = t.length;
      for (; i < l; i++)
        res += t[i];
      return res;
    })();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    reduce
    loop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
Edge 13.10586 on Windows
View result in a separate tab
Test name Executions per second
reduce 110.9 Ops/sec
loop 11.4 Ops/sec