Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash meanBy vs js vs reduce lodash
Comparing performance of: lodash differenceBy with javascript filter and find
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
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:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Lodash meanBy
113244.9 Ops/sec
native js
947584.7 Ops/sec
lodash reduce
906987.8 Ops/sec
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;