Skip to content
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

Report CompileTime metric in flutter build aot --report-timings. #31895

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/flutter_tools/lib/src/base/build.dart
Expand Up @@ -203,7 +203,7 @@ class AOTSnapshotter {
// }

final SnapshotType snapshotType = SnapshotType(platform, buildMode);
final int genSnapshotExitCode = await _timedStep('gen_snapshot', () => genSnapshot.run(
final int genSnapshotExitCode = await _timedStep('snapshot(CompileTime)', () => genSnapshot.run(
snapshotType: snapshotType,
additionalArgs: genSnapshotArgs,
iosArch: iosArch,
Expand Down Expand Up @@ -315,7 +315,7 @@ class AOTSnapshotter {

final String depfilePath = fs.path.join(outputPath, 'kernel_compile.d');
final KernelCompiler kernelCompiler = await kernelCompilerFactory.create(flutterProject);
final CompilerOutput compilerOutput = await _timedStep('frontend', () => kernelCompiler.compile(
final CompilerOutput compilerOutput = await _timedStep('frontend(CompileTime)', () => kernelCompiler.compile(
sdkRoot: artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath, mode: buildMode),
mainPath: mainPath,
packagesPath: packagesPath,
Expand Down Expand Up @@ -361,7 +361,7 @@ class AOTSnapshotter {
final Stopwatch sw = Stopwatch()..start();
final T value = await action();
if (reportTimings) {
printStatus('$marker(RunTime): ${sw.elapsedMilliseconds} ms.');
printStatus('$marker: ${sw.elapsedMilliseconds} ms.');
}
return value;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/test/base/build_test.dart
Expand Up @@ -525,7 +525,7 @@ void main() {

expect(genSnapshotExitCode, 0);
expect(genSnapshot.callCount, 1);
expect(bufferLogger.statusText, matches(RegExp(r'gen_snapshot\(RunTime\): \d+ ms.')));
expect(bufferLogger.statusText, matches(RegExp(r'snapshot\(CompileTime\): \d+ ms.')));
}, overrides: contextOverrides);
});

Expand Down