ngschaider / bier-in-aktion-webapp

0 stars 0 forks source link

change to for-loop (less overhead) #1

Closed cgimpl closed 2 years ago

cgimpl commented 2 years ago

https://github.com/ngschaider/bier-in-aktion-webapp/blob/476083165a7f5106f0f33366d9b193b9e11e2deb/src/components/Content.tsx#L17

ngschaider commented 2 years ago

afaik, this is not possible without introducing more variables which reduces readability by a lot. i was curious and benchmarked this. Actually, map performs faster in comparison to for-loops when the array contains many elements.

I think we can neglect the overhead. Let's think about it again when the overhead gets visible.

Benchmark