Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash reduce vs lodash transform vs Array.reduce 100k
(version: 1)
Comparing performance of:
Lodash reduce vs Native vs Lodash transform
Created:
one year 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 = 100000; var data = []; for (var i = 0; i <= max2; i++) { data.push({ id: i }); }
Tests:
Lodash reduce
_.reduce(data, (acc, item) => { acc[item.id] = item; return acc; }, {})
Native
data.reduce((acc, item) => { acc[item.id] = item; return acc; }, {})
Lodash transform
_.transform(data, (acc, item) => { acc[item.id] = item; }, {})
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Lodash reduce
Native
Lodash transform
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/132.0.0.0 Safari/537.36 Edg/132.0.0.0
Browser/OS:
Chrome 132 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Lodash transform
504/s
Native
499/s
Lodash reduce
441/s
View exact numbers
Test name
Executions per second
✓
Lodash transform
504 Ops/sec
Native
499 Ops/sec
Lodash reduce
441 Ops/sec
Related benchmarks
lodash groupBy vs Array.reduce 100k
lodash groupBy vs Array.reduce on million items
lodash groupBy vs Array.reduce performance
lodash groupBy vs Array.reduce 100k with array push
Comments
Confirm delete:
Do you really want to delete benchmark?