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
 
function getRandomInt(max) {
  return Math.floor(Math.random() * Math.floor(max));
}
var arr = [];
for(var i = 0; i < 51; i++){
  arr.push({value:getRandomInt(100)});
}
Tests:
  • lodash

     
    _.sortBy(arr,"value");
  • sort

     
    arr.sort((a, b) => {
      if (a < b) {
        return -1;
      } else if (a > b) {
        return 1;
      }
      return 0;
    });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash
    sort

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Linux; Android 13; SAMSUNG SM-G985F/G985FXXUFGVJE) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/19.0 Chrome/102.0.5005.125 Mobile Safari/537.36
Chrome Mobile 102 on Android
View result in a separate tab
Test name Executions per second
lodash 55977.6 Ops/sec
sort 40574.2 Ops/sec