-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
From flutter run -v I get the following:
<- compile package:foo/main.dart
[...]
<- reset
<- recompile package:foo/main.dart 995dae5c-e4e5-4515-b1ab-8e81d2f7c950
Digging in to this a bit it:
- Compiles (possibly by initializing from dill) here:
device.generator.recompile( - Waits for the compile (and other stuff) to finish here:
final List<bool> results = await Future.wait(startupTasks); - Then calls
attachhere:--- whichreturn attach( - compiles again here: with a so called full restart --- having the effect of compiling again (e.g. serializing the full (and thus rather big dill file) again) and not sending it to the device (here:
final UpdateFSReport devfsResult = await _updateDevFS(fullRestart: true); ).flutter/packages/flutter_tools/lib/src/devfs.dart
Lines 652 to 660 in 93da78f
if (!bundleFirstUpload) { final String compiledBinary = compilerOutput.outputFilename; if (compiledBinary.isNotEmpty) { final Uri entryUri = _fileSystem.path.toUri(pathToReload); final DevFSFileContent content = DevFSFileContent(_fileSystem.file(compiledBinary)); syncedBytes += content.size; dirtyEntries[entryUri] = content; } }
I don't understand why we do this. For context this - on my machine - adds 1100+ ms to the startup for big apps.
Is there a good reason for doing this, and if not could we not do it? (and if there is could we potentially tweak it a bit?)
/cc @christopherfujino (which I've been told should in many ways be our point of contact).
/cc @aam which seemingly added the "don't send over the dill" stuff 3 years ago in #21133
/cc @chingjun which will be interested in skipping this for big apps too.
pablojimpas
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.