perf: back to temporal optimizer dirs#12622
Merged
Conversation
|
|
9 tasks
Member
Author
dominikg
reviewed
Mar 28, 2023
dominikg
reviewed
Mar 28, 2023
dominikg
reviewed
Mar 28, 2023
dominikg
reviewed
Mar 28, 2023
dominikg
reviewed
Mar 28, 2023
Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
dominikg
approved these changes
Mar 28, 2023
4 tasks
4 tasks
Contributor
|
this PR is causing #13506 |
Contributor
|
@alex-kinokon care to elaborate? this PR mostly restores behavior that was present before. |
Contributor
|
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. |
Contributor
|
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. |
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.
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: falsein 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?