Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Reduce vs Object.groupBy with function
(version: 1)
Testing the new native method
Comparing performance of:
New native groupBy vs Old native reduce
Created:
11 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
var max2 = 100000; var data = []; for (var i = 0; i <= max2; i++) { data.push({ id: i }); } const getId = ({ id }) => id;
Tests:
New native groupBy
Object.groupBy(data, getId)
Old native reduce
data.reduce((acc, item) => { acc[getId(item)] = item; return acc; }, {})
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
New native groupBy
Old native reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
11 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
New native groupBy
115.4 Ops/sec
Old native reduce
652.4 Ops/sec
Related benchmarks:
lodash groupBy vs Array.reduce 2
Reduce with spread VS for...of with push
lodash groupBy vs Array.reduce vs Object.fromEntries 100k
lodash groupBy vs Array.reduce vs Object.groupBy 100k
lodash groupBy vs Object.groupBy 100k
Object.groupBy vs Array.reduce 100k
Reduce vs Object.groupBy
Reduce vs Array.groupBy
Reduce vs Object.groupBy with function 2
Comments
Confirm delete:
Do you really want to delete benchmark?