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:
 
var data = [1,3,2,1,4,5,6,7,8,9,0]
Tests:
  • Lodash

     
    _.chunk(data,2);
  • Native

    x
     
    const chunk = (array, size) => {
      if (size <= 0) {
                return [];
            }
            const result = [];
            const arrayLength = array.length;
            for (let i = 0; i < arrayLength; i += size) {
                result.push(array.slice(i, i + size));
            }
            return result;
    }
    chunk(data,2);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash
    Native

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Lodash 18468316.0 Ops/sec
Native 12216286.0 Ops/sec