Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash map vs array.prototype.map
(version: 0)
Comparing performance of:
_.sortBy vs array.prototype.sort
Created:
7 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:
_.sortBy
const res = _.map(arr,()=>{ "Hello" }); console.log(res)
array.prototype.sort
const res = arr.map(()=>{"Hello"}); console.log(res)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
_.sortBy
array.prototype.sort
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Labels
Unique lodash vs vanilla
Lodash max vs JS Math.max (2022)
Lodash.isArray vs Array.isArray (Lodash v4.17.15)
Comments
Confirm delete:
Do you really want to delete benchmark?