Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
eliya and sharon :) v3
(version: 1)
Comparing performance of:
reduce with push vs flatMap vs reduce with concat
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = Array(100_000_000).fill({entities:[1,2]})
Tests:
reduce with push
arr.reduce((acc, { entities }) => { const newE = entities.map((x) => x); acc.push(...newE); return acc; }, []);
flatMap
arr.flatMap(({ entities }) => entities.map((x) => x));
reduce with concat
arr.reduce((acc, { entities }) => { const newE = entities.map((x) => x); acc.concat(newE); return acc; }, []);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
reduce with push
flatMap
reduce with concat
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?