HTML Preparation code:
AخA
 
1
<script>https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.core.js</script>
Script Preparation code:
 
var data = [{age: 10}, {age: 20}, {age: 40}, {age:40}];
Tests:
  • lodash1

     
    _.sortBy(data, 'age');
  • javascript2

     
    const sortBy = (key) => {
        return (a, b) => (a[key] > b[key]) ? 1 : (b[key] > a[key] ? -1 : 0);
    };
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    lodash1
    javascript2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Chrome 78 on Windows
View result in a separate tab
Test name Executions per second
lodash1 353236.1 Ops/sec
javascript2 310468832.0 Ops/sec