HTML Preparation code:
AخA
 
1
<script>https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.core.js</script>
Script Preparation code:
 
var arr = [
    {name: "test", age: 20},
    {name: "best", age: 30},
    {name: "blah", age: 50},
    {name: "js", age: 10},
    {name: "style", age: 29},
];
Tests:
  • Lodash

     
    _.sortBy(arr, 'age');
  • Javascript

    x
     
    var sortBy = (key) => {
      return (a, b) => (a[key] > b[key]) ? 1 : ((b[key] > a[key]) ? -1 : 0);
    };
    arr.sort(sortBy('age'));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Lodash
    Javascript

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119 on Windows
View result in a separate tab
Test name Executions per second
Lodash 1287940.8 Ops/sec
Javascript 6367210.0 Ops/sec