Report CompileTime metric in flutter build aot --report-timings. (#31895)
This is the correct metric to report for compilation time benchmarks rather than RunTime. Rename the 'gen_snapshot' value to merely 'snapshot' for backwards compatibility and overall simplicity. This change simplifies Dart's benchmarking of Flutter by making it easier to adopt --report-timings (made for Dart to use), which makes the benchmarks much more robust.
This commit is contained in:
committed by
Vyacheslav Egorov
parent
b702d5a38d
commit
8b9eb3e2b2
@@ -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,
|
||||
@@ -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,
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user