Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
stews test
(version: 0)
Comparing performance of:
map filter vs reduce
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = []; for (var i = 0; i < 12345; i++) { arr[i] = {x: "tset", i: i}; }
Tests:
map filter
filterMap = arr.filter(item => item.i % 2 === 0).map(item => item.x);
reduce
reduce = arr.reduce((acc, item) => { if(item.i % 2 === 0){ acc.push(item.x); } return acc; }, []);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
map filter
reduce
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!
Related benchmarks:
For .. of vs For i
testtmptmptmp
huihuhiuhuh
iterator speed
iterator speed1
Comments
Confirm delete:
Do you really want to delete benchmark?