Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash maxBy vs orderBy
(version: 0)
Comparing performance of:
_.maxBy & _.minBy vs head last orderBy
Created:
3 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
function getRandomInt(max) { return Math.floor(Math.random() * Math.floor(max)); } var arr = []; for(var i = 0; i < 100000; i++){ arr.push({value:getRandomInt(100)}); }
Tests:
_.maxBy & _.minBy
_.maxBy(arr,"value"); _.minBy(arr,"value");
head last orderBy
const res = _.orderBy(arr, 'value'); _.head(res); _.last(res);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
_.maxBy & _.minBy
head last orderBy
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
7 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Browser/OS:
Chrome 140 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
_.maxBy & _.minBy
489.2 Ops/sec
head last orderBy
24.2 Ops/sec
Related benchmarks:
Lodash orderBy vs array.prototype.sort
Lodash orderBy vs array.prototype.sort (3)
Lodash orderBy() vs array.prototype.sort
Lodash sortBy vs orderBy performance
Lodash orderBy vs array.prototype.sort fork
Comments
Confirm delete:
Do you really want to delete benchmark?