Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash meanBy vs js vs reduce lodash
(version: 1)
Comparing performance of: lodash differenceBy with javascript filter and find
Comparing performance of:
Lodash meanBy vs native js vs lodash reduce
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
var data = []; for (let i = 0; i < 1000; i++) { data.push({ value: Math.random() * 100 }); }
Tests:
Lodash meanBy
_.meanBy(data, 'value');
native js
data.reduce((sum, obj) => sum + obj.value, 0) / data.length;
lodash reduce
_.reduce(data, (sum, obj) => sum + obj.value, 0) / data.length;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Lodash meanBy
native js
lodash reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser/OS:
Chrome 135 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash meanBy
113244.9 Ops/sec
native js
947584.7 Ops/sec
lodash reduce
906987.8 Ops/sec
Related benchmarks:
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
Lodash sumBy vs reduce - II
avgBy reduce vs inline
Comments
Confirm delete:
Do you really want to delete benchmark?