fix(tool): initialize asset isModified state on startup to prevent 2x hot restart slowdown#187488
Open
kevmoo wants to merge 2 commits into
Open
fix(tool): initialize asset isModified state on startup to prevent 2x hot restart slowdown#187488kevmoo wants to merge 2 commits into
kevmoo wants to merge 2 commits into
Conversation
… hot restart slowdown Prior to this fix, the first hot restart would incorrectly detect all assets as modified and sync/recompile all of them. This was because DevFS.updateBundle bypassed the asset loop during the initial application startup, which prevented the stateful isModified getter from being initialized. This fix accesses isModified for each asset in the bundle during startup to initialize the cache, matching the behavior before the asset processing refactor. Fixes flutter#187391
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates DevFS.updateBundle to initialize the isModified state of assets during the first upload when syncing is skipped, preventing unnecessary recompilation on subsequent hot restarts. A corresponding test was added to verify this behavior. The review feedback suggests simplifying the asset iteration in DevFS.updateBundle by iterating directly over bundle.entries.values instead of bundle.entries.entries since the keys are not used.
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.
Prior to this fix, the first hot restart would incorrectly detect all assets as modified and sync/recompile all of them. This was because DevFS.updateBundle bypassed the asset loop during the initial application startup, which prevented the stateful isModified getter from being initialized.
This fix accesses isModified for each asset in the bundle during startup to initialize the cache, matching the behavior before the asset processing refactor.
Fixes #187391