Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash sumBy vs reduce - II
(version: 1)
Comparing performance of:
_.sumBy vs reduce
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/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:
_.sumBy
_.sumBy(arr,"value");
reduce
arr.reduce((prev, next) => prev + next.value, 0);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
_.sumBy
reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
_.sumBy
1057.4 Ops/sec
reduce
1409.7 Ops/sec
Related benchmarks:
Lodash sumBy vs map and reduce
Lodash sumBy vs reduce
Lodash sumBy vs simple reduce
Lodash sumBy vs reduce 100 elements
Lodash sumBy vs reduce vs for loop
[2024] Lodash .sumBy vs. Reduce with / 1000
[2024] Lodash .sumBy vs. Reduce with / 10002
Lodash sumBy vs reduce v0.0.1
Lodash sumBy with lambda vs Array reduce
Comments
Confirm delete:
Do you really want to delete benchmark?