Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

Description

Part of the investigation of go/flutter-improving-devfs-reliability revealed an easy optimization for hot reload/restart on desktop devices. This should improve performance of hot restart by several hundred milliseconds and reduce memory usage of both the tool and application.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 21, 2020
@override
Future<UpdateFSReport> update({
Uri mainUri,
@required Uri mainUri,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a reorganization of the params to match the parent devFS class, which revealed that 'pathToReload' was missing a required

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

I wish we had more desktop integration tests...

content.copySync(destination.path);
continue;
}
destination.writeAsBytesSync(await devFSContent.contentsAsBytes());
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: fall through is for DevFSStringContent/DevFSByteContent

@jonahwilliams
Copy link
Contributor Author

We do have macOS hot reload/restart tests thankfully. I double check what the status is for linux/windows


/// An implementation of a devFS writer which copies physical files for devices
/// running on the same host.
class DesktopDevFSWriter implements DevFSWriter {
Copy link
Member

Choose a reason for hiding this comment

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

We also discussed using this same code for the iOS simulator (can be in a future PR).

@required MacOSWorkflow macOSWorkflow,
@required ProcessManager processManager,
@required Logger logger,
@required FileSystem fileSystem,
Copy link
Member

Choose a reason for hiding this comment

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

g3 doesn't like this new @required, it's passing one into the context.

LinuxDevices({
@required Platform platform,
@required FeatureFlags featureFlags,
@required FileSystem fileSystem,
Copy link
Member

Choose a reason for hiding this comment

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

Same, g3 doesn't like this new @required.

@jonahwilliams
Copy link
Contributor Author

We could actually figure out if this is usable on Android by checking if the created devFS directory exists on the host file system

@jonahwilliams
Copy link
Contributor Author

Updated to make this landable in g3, no longer enables the change immediately

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.

4 participants