Add debug_second_compile_millis benchmark metric (#77420)
This commit is contained in:
parent
c9d68ba75f
commit
e9e8ca7640
@ -1000,9 +1000,21 @@ class CompileTest {
|
||||
await device.unlock();
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
final Map<String, dynamic> compileRelease = await _compileApp(reportPackageContentSizes: reportPackageContentSizes);
|
||||
final Map<String, dynamic> compileDebug = await _compileDebug(
|
||||
clean: true,
|
||||
metricKey: 'debug_full_compile_millis',
|
||||
);
|
||||
// Build again without cleaning, should be faster.
|
||||
final Map<String, dynamic> compileSecondDebug = await _compileDebug(
|
||||
clean: false,
|
||||
metricKey: 'debug_second_compile_millis',
|
||||
);
|
||||
|
||||
final Map<String, dynamic> metrics = <String, dynamic>{
|
||||
...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<Map<String, dynamic>> _compileDebug() async {
|
||||
await flutter('clean');
|
||||
static Future<Map<String, dynamic>> _compileDebug({
|
||||
@required bool clean,
|
||||
@required String metricKey,
|
||||
}) async {
|
||||
if (clean) {
|
||||
await flutter('clean');
|
||||
}
|
||||
final Stopwatch watch = Stopwatch();
|
||||
final List<String> options = <String>['--debug'];
|
||||
switch (deviceOperatingSystem) {
|
||||
@ -1109,7 +1126,7 @@ class CompileTest {
|
||||
watch.stop();
|
||||
|
||||
return <String, dynamic>{
|
||||
'debug_full_compile_millis': watch.elapsedMilliseconds,
|
||||
metricKey: watch.elapsedMilliseconds,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user