Open
Conversation
|
Thanks for the analysis Indeed we have some https://github.com/facebook/create-react-app/blob/main/packages/react-dev-utils/openBrowser.js#L76 I'll see how to refactor it and use a worker thread for that logic, thanks for letting me know. Will see later for the 2nd problem. Not that the changelog is a custom plugin on our website, and Docusaurus users do not use it (but there are similar community plugins). |
This was referenced Mar 19, 2025
Owner
Author
|
|
Awesome thanks, I also see that the upgrade (facebook#11114) made the dev server startup time much faster 🔥 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Platform
Prepare
Enable rspack tracing and JS profiler features by environment. This PR provides a simple implementation, more detail see
For Development
Steps
Optimization
From the js profiler, we can find that the red block is
openBrowserblocking the nodejs main thread and causing rspack to get stuck. We should be able to let theopenBrowserexecute in another thread to avoid this.openBrowser. The rebuild takes about 2.5s, but 1.8s are consumed in the make stage.It seems that many files are rebuilt on hot start, from the
NormalModule:buildparameter we can find that most of them come from thechangelogdirectory.From the source code, I found that the changelog directory will be regenerated when loadContent is called at https://github.com/facebook/docusaurus/blob/main/website/src/plugins/changelog/index.ts#L159. And a hot start will regenerate it which will make the persistent cache rebuild them since the modification time of those files has been updated.
Here are some solutions I can think of:
Performance
After disable
openBrowserand configexperiments.cache.snapshot.immutablePaths = [/\/changelog\//]