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 device.unlock();
|
||||||
await flutter('packages', options: <String>['get']);
|
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>{
|
final Map<String, dynamic> metrics = <String, dynamic>{
|
||||||
...await _compileApp(reportPackageContentSizes: reportPackageContentSizes),
|
...compileRelease,
|
||||||
...await _compileDebug(),
|
...compileDebug,
|
||||||
|
...compileSecondDebug,
|
||||||
};
|
};
|
||||||
|
|
||||||
return TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList());
|
return TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList());
|
||||||
@ -1082,8 +1094,13 @@ class CompileTest {
|
|||||||
return metrics;
|
return metrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> _compileDebug() async {
|
static Future<Map<String, dynamic>> _compileDebug({
|
||||||
await flutter('clean');
|
@required bool clean,
|
||||||
|
@required String metricKey,
|
||||||
|
}) async {
|
||||||
|
if (clean) {
|
||||||
|
await flutter('clean');
|
||||||
|
}
|
||||||
final Stopwatch watch = Stopwatch();
|
final Stopwatch watch = Stopwatch();
|
||||||
final List<String> options = <String>['--debug'];
|
final List<String> options = <String>['--debug'];
|
||||||
switch (deviceOperatingSystem) {
|
switch (deviceOperatingSystem) {
|
||||||
@ -1109,7 +1126,7 @@ class CompileTest {
|
|||||||
watch.stop();
|
watch.stop();
|
||||||
|
|
||||||
return <String, dynamic>{
|
return <String, dynamic>{
|
||||||
'debug_full_compile_millis': watch.elapsedMilliseconds,
|
metricKey: watch.elapsedMilliseconds,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user