Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Benchmarkadawdawdwada
(version: 1)
Comparing performance of:
map-filter vs reduce
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const arr = [1, 2, 3];
Tests:
map-filter
const arr = [1, 2, 3]; console.log(arr.filter((num) => num > 2).map((num) => num * 2))
reduce
const arr = [1, 2, 3]; console.log(arr.reduce((acc, num) => { if(num <= 2) return acc acc.push(num * 2) 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:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Browser/OS:
Chrome Mobile 131 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
map-filter
126519.3 Ops/sec
reduce
122555.0 Ops/sec
Related benchmarks:
Occurance with filter or forEach
find max el of array
reduce() vs filter().map() V2
reduce() vs filter().map() V3
flatMap() vs filter().map() vs reduce
filter vs for performance
Map vs Filter
Reduce vs Filter and Map
performance of filter + map vs reduce
Comments
Confirm delete:
Do you really want to delete benchmark?