-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve dev mode performance #1232
Conversation
Your Render PR Server URL is https://toolpad-pr-1232.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cde0344gqg42mra7c6mg. |
Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
Co-authored-by: Vytautas Butkus <vytautas.butkus@gmail.com> Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
Co-authored-by: Vytautas Butkus <vytautas.butkus@gmail.com> Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I can't really tell the difference between how these changes work and what was before 🤔
Could it be that we are looking at different things? I'm checking by switching between pages, but it "feels" like the time it takes to load is very similar. Nevertheless approving this ✅
Screen.Recording.2022-10-31.at.12.14.40.mov
I didn't measure it exactly, but I see a clear difference: Screen.Recording.2022-10-31.at.11.21.01.movafter: Screen.Recording.2022-10-31.at.11.21.39.movAlso Toolpad is much more responsive while switching the pages, I can actually click the hierarchy menus now. |
I can see the difference in your recording, but I'm unable to reproduce same on my machine 🤔 are you running |
In usually run |
I have checked out branch locally, just tried to run @apedroferreira could you also check? While it seems that I might be missing something on my end, it would be good to verify |
I doubt it, only the database is running in docker in development mode. |
Doesn't really make a difference for me... My console shows the time each route takes to compile and the wait times are pretty huge: Here some of them take about 5 seconds and one of them more than 30 seconds. So it can take a long time for me to open an app for the first time in dev - once it shows it's faster with the hot reload. Another run: 5.7s + 14s + 3.4s, not sure if these times are unusual: |
Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
It's important to understand that Next.js optimizes for startup time in dev mode. That means it will compile sources on-demand. As soon as it is compiled once, the HMR should make incremental compilation faster. The consequence is that the first time opening a page will be a little slower. It's either this or longer startup time. Here's to hoping that the upcoming |
I personally don't care much about initial load time as I understand it always takes longer. The problem is that page load time for me doesn't change even when I'm not changing any code, i.e. I just click back and forth between pages it takes as much time as in your video of "before". That's why I'm puzzled why I'm not seeing same improvement as you do 🤔 |
If we can't find any more quick wins I'm fine with things staying as they are and hoping upcoming Next.js updates improve things, it's not that bad of an issue to spend more time on it in my opinion. |
As per last retro, removing this (
import { Error as ErrorIcon } from '@mui/icons-material';
) import improves performance a lot. For now we can just pass a component down. Hopefully we can eventually move forward with mui/material-ui#30510Alternatively we can explore compiling these packages to commonjs
@apedroferreira @bytasv please try out in your local and let me know if it improves things