-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
perf: back to temporal optimizer dirs #12622
Conversation
Run & review this pull request in StackBlitz Codeflow. |
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.
Some nits below, but this works great locally for me. RIP #12582 2023-2023
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.
Nice comments!
Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
this PR is causing #13506 |
@alex-kinokon care to elaborate? this PR mostly restores behavior that was present before. |
Copied from the issue: If a file does not exist, it will throw 504 Outdated Optimize Dep and ask the user to reload the page. Reloading the page obviously won’t make the file appear. |
This looks to be a broken dependency, the error message in this case is indeed a bit misleading, but it is not the cause of the issue here. It wouldn't have worked either way. |
Closes #12592
Description
Reverts #12582
Reverts #12603 (partial, there was a fix for #12593 in it)
@sun0day found that there was a ~80ms perf regression in https://github.com/sun0day/vite-2.7-slow after #12582. Using
write: false
in esbuild forces esbuild to populateresult.outputFiles
. It is counter-intuitive, but this is slower than writing files to disk and reading them back.@dominikg presented concerns about the new scheme after
write: false
(see #12592). We tried to avoid potential issues in #12603 with @bluwy. So the implementation ended up as complex as before, and slower.The benefit of the new scheme was to fix #9986. This PR gets us back to the temporal dirs scheme using the new rename-rename-then-delete technique proposed by @dominikg. Hopefully, we will regain the 80ms and keep #9986 closed after this PR.
There are also some clean-ups.
A change compared to pre-#12582 is that when no dependencies are found, we were not committing the result. This means that for projects without dependencies, the scanner will run every time because we never saved a _metadata.json that indicates there aren't dependencies. After this PR, we are now committing the optimization result in this case too.
What is the purpose of this pull request?