-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[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
Conversation
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.
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) { |
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.
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?
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.
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
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.
Is there a good place to put this information in a comment or comments in the code?
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.
I added some more details above on _cacheUserSessionInformation
Landing, since this code does not run in g3 |
Or not, lets let the tree do it |
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.