这是indexloc提供的服务,不要输入任何密码
Skip to content

[flutter_tools] skip copying 1GB of data from chrome cache dirs #81170

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

Merged
merged 2 commits into from
Apr 26, 2021

Conversation

jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Apr 25, 2021

Fixes #81160

And unfortunately this blocks on both startup and teardown. The issues is that there appears to be about ~ 1 GB of binary data present in these folders. On my fairly beefy desktop machine this takes ~15 seconds on startup and another ~15 seconds on tear down.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 25, 2021
@google-cla google-cla bot added the cla: yes label Apr 25, 2021
@jonahwilliams jonahwilliams requested a review from zanderso April 26, 2021 15:03
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know enough about how the cache dir works to add some doc comments to ChromiumLauncher.launch for the relevant parameter?

}
} on FileSystemException catch (err) {
_logger.printError('Failed to restore Chrome preferences: $err');
}
}

// Cache, Code Cache, and GPUCache are nearly 1GB of data
bool _isNotCacheDirectory(Directory directory) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be an allowlist instead of denylist? Are there any docs from Chrome that this could link to to monitor for removals/additions to this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that allowlist would be a better solution, but significantly more time consuming to maintain. Unfortunately I wasn't able to find much in terms of docs here (CodeCache is CodeCacheHost, which seems to be storing cached compiled metadata. Gpu cache is something similar.

I don't have a great idea of what is in Cache itself, but imo it doesn't really matter. The original intention of this copying cache behavior was to preserve things like browser window size and local storage - but I don't think we can reasonably spend ~15 seconds blocking at startup/teardown to support this. Either the current profile information we copy is sufficient, or we should direct users to use a different dev workflow, instead of slowing everyone down.

We could of course remove the caching behavior altogether, though I think that might be more noticeable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good place to put this information in a comment or comments in the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some more details above on _cacheUserSessionInformation

@jonahwilliams
Copy link
Contributor Author

Landing, since this code does not run in g3

@jonahwilliams
Copy link
Contributor Author

Or not, lets let the tree do it

@jonahwilliams jonahwilliams merged commit 52661bc into flutter:master Apr 26, 2021
@jonahwilliams jonahwilliams deleted the skip_cache_dirs branch April 26, 2021 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tool spends 10-20 seconds copying Chrome Profile information for web run
2 participants