Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
for-foreach-map with lodash
(version: 2)
Validate benchmark has passed, but...
Comparing performance of:
For with Array vs For with lodash's range vs foreach and push vs map
Created:
2 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
Tests:
For with Array
let result = []; for(let i=0;i<100;i++) { result[i] = i + [...Array(20).keys()].join(''); }
For with lodash's range
let result = []; for(let i=0;i<100;i++) { result[i] = i + _.range(20).join(''); }
foreach and push
let result = []; _.forEach(_.range(100), (i) => { result.push(i + _.range(20).join('')); });
map
let result = _.map(_.range(100), (i) => (i + _.range(20).join('')) );
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
For with Array
For with lodash's range
foreach and push
map
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?