HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
 
var arr = [{ a: 1 }, { a: 5 }, { a: 11 }, { a: 55 }];
Tests:
  • Native

     
    const total = arr.map(x => x.a).reduce((prev,curr) => prev + curr, 0);
  • Lodash

     
    const total = _.sumBy(arr, x => x.a);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Native
    Lodash

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
Chrome 89 on Mac OS X 10.15.6
View result in a separate tab
Test name Executions per second
Native 10486937.0 Ops/sec
Lodash 3640916.8 Ops/sec