diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index e0092a44cf..4837a72a55 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -1000,9 +1000,21 @@ class CompileTest { await device.unlock(); await flutter('packages', options: ['get']); + final Map compileRelease = await _compileApp(reportPackageContentSizes: reportPackageContentSizes); + final Map compileDebug = await _compileDebug( + clean: true, + metricKey: 'debug_full_compile_millis', + ); + // Build again without cleaning, should be faster. + final Map compileSecondDebug = await _compileDebug( + clean: false, + metricKey: 'debug_second_compile_millis', + ); + final Map metrics = { - ...await _compileApp(reportPackageContentSizes: reportPackageContentSizes), - ...await _compileDebug(), + ...compileRelease, + ...compileDebug, + ...compileSecondDebug, }; return TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList()); @@ -1082,8 +1094,13 @@ class CompileTest { return metrics; } - static Future> _compileDebug() async { - await flutter('clean'); + static Future> _compileDebug({ + @required bool clean, + @required String metricKey, + }) async { + if (clean) { + await flutter('clean'); + } final Stopwatch watch = Stopwatch(); final List options = ['--debug']; switch (deviceOperatingSystem) { @@ -1109,7 +1126,7 @@ class CompileTest { watch.stop(); return { - 'debug_full_compile_millis': watch.elapsedMilliseconds, + metricKey: watch.elapsedMilliseconds, }; }