How can I improve performance for the "request waterfall" for Vite #213
-
Hello, I have a general open-ended question about the performance of vite and figured I'd start by asking on vite-ruby instead of vite. I'm not necessarily looking for someone to solve my problem, I expect it's quite complicated but I'm hoping someone with more Vite knowledge can point me in the right direction. I'm not sure what I should focus on to improve the load times in development. Q1: What are some common strategies or things I should be looking at to improve performance on the "network waterfall" when the dev-server is running? For context, I'm working in a large codebase that has ~4,000 (JS/TS/JSX/TSX) files and ~500 SCSS files. I love the startup time of the dev server and HMR when compared to webpack. However, the initial load times are quite slow. For example, it can take >50 seconds after logging in as a user for the page to load in local development. That is quite slow (example of request waterfall after logging in below). Reloads are a bit faster because the browser will cache resources, I'm interested in improving the initial load though. Q2: Are there examples of other large repositories that are using vite-ruby and have reasonable load times in local development? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi Jeremiah! @jeremiah-clothier Since this isn't specific to Vite Ruby, I'd encourage you to ask in the Vite.js Discussions, since there are significantly more users in the broader ecosystem.
When using Vite, the initial load time will be greatly reduced if you avoid loading any code that is not critical for the current page.
In combination, these three techniques can help to make the initial load in development faster, and the first two can also have a positive impact in the final production bundle and UX. |
Beta Was this translation helpful? Give feedback.
Hi Jeremiah! @jeremiah-clothier
Since this isn't specific to Vite Ruby, I'd encourage you to ask in the Vite.js Discussions, since there are significantly more users in the broader ecosystem.
When using Vite, the initial load time will be greatly reduced if you avoid loading any code that is not critical for the current page.