HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.min.js'></script>
Script Preparation code:
 
var values = Array(10000).fill(null).map((x, a) => ({number: a}));
var filterFn = x => !(x.number % 5);
var mapFn = x => x.number;
var reduceFn = (a, b) => a > b ? a : b;
Tests:
  • Native array functions

     
    const result1 = values.filter(filterFn).map(mapFn).reduce(reduceFn);
    console.log(result1);
  • Lodash

     
    const result2 = _(values).filter(filterFn).map(mapFn).max();
    console.log(result2);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Native array functions
    Lodash

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1 Safari/605.1.15
Safari 18 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Native array functions 37549.9 Ops/sec
Lodash 36757.1 Ops/sec