Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
filter-map vs reduce
(version: 0)
modified version of `map-filter vs reduce` that switches the order of operations
Comparing performance of:
map-filter vs reduce
Created:
6 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
a=[]; for(i=0;i<1000;i++) a.push(Number(i)/1000); var filtering=x=>(x*114514)%1>0.5; var mapping=x=>x+0.1919; var reducing=(acc,x)=>{ var value=mapping(x); if(filtering(value)) acc.push(value); return acc; }
Tests:
map-filter
a.filter(filtering).map(mapping);
reduce
a.reduce(reducing,[]);
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:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 YaBrowser/25.8.0.0 Safari/537.36
Browser/OS:
Yandex Browser 25 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
map-filter
51299.7 Ops/sec
reduce
59169.4 Ops/sec
Related benchmarks:
filter-map vs reduce vs reduce with destructuring
filter-map vs reduce fixed
filter-map vs reduce 2
filter-map vs reduce 100k
Comments
Confirm delete:
Do you really want to delete benchmark?