feat: persistent cache snapshot save file hash by default#10050
Merged
jerrykingxyz merged 1 commit intomainfrom Apr 17, 2025
Merged
feat: persistent cache snapshot save file hash by default#10050jerrykingxyz merged 1 commit intomainfrom
jerrykingxyz merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for rspack canceled.
|
CodSpeed Performance ReportMerging #10050 will not alter performanceComparing 🎉 Hooray!
|
75d8914 to
551ce57
Compare
LingyuCoder
approved these changes
Apr 17, 2025
Contributor
|
can this issue #9064 be closed? |
Contributor
Author
No, this is another bug caused by storage invalidation, not snapshot invalidation. I will fix it in another PR. |
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.
Summary
The persistent cache snapshot will store the compile times and use them to calculate which files were modified when hot start. However, this strategy is invalid in scenarios such as CI because the update time of all files will be refreshed.
This PR will make snapshot store both compile time and file hash, and when calculate modified files the file hash will be compared when the file modification time has been updated.
This PR will introduce some performance regression due to the addition of hash calculations, and I manually benchmarked the performance of snapshot generation in cold start.
As can be seen from the table above, this takes three times longer than before, and the main time consumption occurs in file IO. This is currently acceptable in large real projects.
PS. For hot start, it will take 3 times longer if you update a lot of files like in CI, otherwise it will be the same as before. HMR will create snapshots incrementally so the performance impact is smaller.
Checklist