12

PR comment: You don't need this useCallback and this useMemo, it's premature optimization, this component will not have a lot of rerenders anyway.

*remove it and merge it*

Few weeks later...
Slack message: why the app is so slow???

*opens a PR putting back all "premature" optimizations*

PR comment: Hum... I don't think that's it, but let's try it.

*merge it*

*slowness is gone*

Slack message: wow! How did you figured out so quickly???

Me: I was lucky, I guess ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

Comments
  • 6
    I would probably have fought that first comment as there normally is a reason for the optimizations i do. And yes "my gut feeling is that this indeed might get rerendered a fucking lot" is a valid reason.
  • 5
    Hey, one thing is premature optimization, another is fixing prematurely bad code
Add Comment