DEV Community

Discussion on: 1 Simple Trick to Boost Performance Using Reduce

Collapse
 
dwilmer profile image
Daan Wilmer • Edited

Good point! I just did that, and this is what I get:

map time (ms): 13755.813225030899
filter time(ms): 3706.2631920576096
reduce time(ms): 3794.9764149188995
for-loop time(ms): 2467.463256955147
Enter fullscreen mode Exit fullscreen mode

Somehow, for me, the map-time takes about four times as long as the other functions (it's weird and I have no clue why), but the for-loop outperforms all others.