Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.reduce vs lodash groupBy 500k
(version: 1)
Comparing performance of:
Lodash vs Native
Created:
7 months ago
by:
Guest
Go 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:
var max2 = 500000; var data = []; for (var i = 0; i <= max2; i++) { data.push({ id: i }); }
Tests:
Lodash
_.groupBy(data, 'id')
Native
data.reduce((acc, item) => { const value = item['id']; if (!acc[value]) { acc[value] = [item]; } else { acc[value].push(item); } return acc; }, {})
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash
Native
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/143.0.0.0 Safari/537.36
Browser/OS:
Chrome 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Native
74/s
Lodash
37/s
View exact numbers
Test name
Executions per second
✓
Native
74 Ops/sec
Lodash
37 Ops/sec
Related benchmarks
lodash groupBy vs Array.reduce 100k
lodash groupBy vs Array.reduce on million items
lodash groupBy vs Array.reduce 100k better 2
lodash groupBy vs Array.reduce group by 100k
Comments
Confirm delete:
Do you really want to delete benchmark?