Place existing dill into hot reload temp directory to boost initialization time (#40366)

This commit is contained in:
Jonah Williams
2019-09-12 12:45:53 -07:00
committed by GitHub
parent a6138bb005
commit 1fec30efb6
2 changed files with 17 additions and 0 deletions

View File

@@ -530,6 +530,16 @@ abstract class ResidentRunner {
if (!artifactDirectory.existsSync()) {
artifactDirectory.createSync(recursive: true);
}
// TODO(jonahwilliams): this is a temporary work around to regain some of
// the initialize from dill performance. Longer term, we should have a
// better way to determine where the appropriate dill file is, as this
// doesn't work for Android or macOS builds.}
if (dillOutputPath == null) {
final File existingDill = fs.file(fs.path.join('build', 'app.dill'));
if (existingDill.existsSync()) {
existingDill.copySync(fs.path.join(artifactDirectory.path, 'app.dill'));
}
}
}
@protected