Last active
October 30, 2025 11:34
-
-
Save tusharxoxoxo/d6a5a2b1061bfe0cc4e23e972742f5ed to your computer and use it in GitHub Desktop.
superteam earn performance bottle neck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
these are the issue in the initial 1 second of the website load
i have compiled this data using react scan
https://github.com/aidenybai/react-scan
the following these points are summarised by ai
High level
Low level
We also have lower level information about react components, such as their render time, and which props/state/context changed when they re-rendered.
Your should split your goals into 2 parts:
Make sure to check if the user has the react compiler enabled (project dependent, configured through build tool), so you don't unnecessarily memoize components. If it is, you do not need to worry about memoizing user components
One challenge you may face is the performance problem lies in a node_module, not in user code. If you are confident the problem originates because of a node_module, there are multiple strategies, which are context dependent:
We have the high level time of how much react spent rendering, and what else the browser spent time on during this slowdown
We also have lower level information about react components, such as their render time, and which props/state/context changed when they re-rendered.
You may notice components have many renders, but much fewer props/state/context changes. This normally implies most of the components could of been memoized to avoid computation
It's also important to remember if a component had no props/state/context change, and it was memoized, it would not render. So the flow should be:
An important thing to note is that if you see a lot of react renders (some components with very high render counts), but other time is much higher than render time, it is possible that the components with lots of renders run hooks like useEffect/useLayoutEffect, which run outside of what we profile (just react render time).
It's also good to note that react profiles hook times in development, and if many hooks are called (lets say 5,000 components all called a useEffect), it will have to profile every single one. And it may also be the case the comparison of the hooks dependency can be expensive, and that would not be tracked in render time.
If a node_module is the component with high renders, you can experiment to see if that component is the root issue (because of hooks). You should use the same instructions for node_module debugging mentioned previously.
If renders don't seem to be the problem, see if there are any expensive CSS properties being added/mutated, or any expensive DOM Element mutations/new elements being created that could cause this slowdown.
Your should split your goals into 2 parts:
Make sure to check if the user has the react compiler enabled (project dependent, configured through build tool), so you don't unnecessarily memoize components. If it is, you do not need to worry about memoizing user components
One challenge you may face is the performance problem lies in a node_module, not in user code. If you are confident the problem originates because of a node_module, there are multiple strategies, which are context dependent:
We have the high level time of how much react spent rendering, and what else the browser spent time on during this slowdown
We also have lower level information about react components, such as their render time, and which props/state/context changed when they re-rendered.
You may notice components have many renders, but much fewer props/state/context changes. This normally implies most of the components could of been memoized to avoid computation
It's also important to remember if a component had no props/state/context change, and it was memoized, it would not render. So the flow should be:
An important thing to note is that if you see a lot of react renders (some components with very high render counts), but other time is much higher than render time, it is possible that the components with lots of renders run hooks like useEffect/useLayoutEffect, which run outside of what we profile (just react render time).
It's also good to note that react profiles hook times in development, and if many hooks are called (lets say 5,000 components all called a useEffect), it will have to profile every single one. And it may also be the case the comparison of the hooks dependency can be expensive, and that would not be tracked in render time.
If a node_module is the component with high renders, you can experiment to see if that component is the root issue (because of hooks). You should use the same instructions for node_module debugging mentioned previously.
If renders don't seem to be the problem, see if there are any expensive CSS properties being added/mutated, or any expensive DOM Element mutations/new elements being created that could cause this slowdown.