-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[flutter_tools] check asset files while the tool waits for the frontend_server compile #67826
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
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
if (fullRestart) { | ||
generator.reset(); | ||
} | ||
// On a full restart, or on an initial compile for the attach based workflow, |
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.
This logic is unchanged, but the asset stat was placed in between the pendingCompilerOutput
resolution.
// The tool writes the assets into the AssetBundle working dir so that they | ||
// are in the same location in DevFS and the iOS simulator. | ||
final String assetBuildDirPrefix = _asUriPath(getAssetBuildDirectory()); | ||
final String assetDirectory = getAssetBuildDirectory(); | ||
bundle.entries.forEach((String archivePath, DevFSContent content) { |
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.
Where does the stat happen? Is it done as part of the isModified
and size
getters?
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.
Done
// this will produce a full dill. Subsequent invocations will produce incremental | ||
// dill files that depend on the invalidated files. | ||
_logger.printTrace('Compiling dart to kernel with ${invalidatedFiles.length} updated files'); | ||
final Future<CompilerOutput> pendingCompilerOutput = generator.recompile( |
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.
Maybe add a comment here explaining why the Future
is awaited later.
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.
Done
Description
On every hot reload, the flutter tool must file stat each asset in the bundle. With a large number of assets or a slow file system, this can take 20 - 30 ms. Do this operation while the flutter tool is waiting for a response from the frontend_server.
No tests updated since this is only a timing update. Any difference in behavior will be shown on benchmarks