HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
x
 
var array = [];
var max = 10000;
for (let i = 1; i <= max; ++i) {
  array.push(i);
}
Tests:
  • Lodash reduce

     
    _.reduce(array, (sum, number) => sum += number, 0);
  • Native reduce

     
    array.reduce((sum, number) => sum += number, 0);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash reduce
    Native reduce

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76 on Windows
View result in a separate tab
Test name Executions per second
Lodash reduce 10130.2 Ops/sec
Native reduce 29518.6 Ops/sec