diff --git a/dev/devicelab/bin/tasks/image_list_jit_reported_duration.dart b/dev/devicelab/bin/tasks/image_list_jit_reported_duration.dart new file mode 100644 index 0000000000..235fa0c275 --- /dev/null +++ b/dev/devicelab/bin/tasks/image_list_jit_reported_duration.dart @@ -0,0 +1,19 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:flutter_devicelab/framework/framework.dart'; +import 'package:flutter_devicelab/framework/utils.dart'; +import 'package:flutter_devicelab/tasks/perf_tests.dart'; + +Future main() async { + await task(ReportedDurationTest( + ReportedDurationTestFlavor.debug, + '${flutterDirectory.path}/examples/image_list', + 'lib/main.dart', + 'com.example.image_list', + RegExp(r'===image_list=== all loaded in ([\d]+)ms.'), + ).run); +} diff --git a/dev/devicelab/bin/tasks/image_list_reported_duration.dart b/dev/devicelab/bin/tasks/image_list_reported_duration.dart index 0d55abb3fa..88ca05680a 100644 --- a/dev/devicelab/bin/tasks/image_list_reported_duration.dart +++ b/dev/devicelab/bin/tasks/image_list_reported_duration.dart @@ -10,6 +10,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart'; Future main() async { await task(ReportedDurationTest( + ReportedDurationTestFlavor.release, '${flutterDirectory.path}/examples/image_list', 'lib/main.dart', 'com.example.image_list', diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index 7c67fed774..86e4b5a59c 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -609,9 +609,26 @@ class MemoryTest { } } -class ReportedDurationTest { - ReportedDurationTest(this.project, this.test, this.package, this.durationPattern); +enum ReportedDurationTestFlavor { + debug, profile, release +} +String _reportedDurationTestToString(ReportedDurationTestFlavor flavor) { + switch (flavor) { + case ReportedDurationTestFlavor.debug: + return 'debug'; + case ReportedDurationTestFlavor.profile: + return 'profile'; + case ReportedDurationTestFlavor.release: + return 'release'; + } + throw ArgumentError('Unexpected value for enum $flavor'); +} + +class ReportedDurationTest { + ReportedDurationTest(this.flavor, this.project, this.test, this.package, this.durationPattern); + + final ReportedDurationTestFlavor flavor; final String project; final String test; final String package; @@ -645,7 +662,7 @@ class ReportedDurationTest { print('launching $project$test on device...'); await flutter('run', options: [ '--verbose', - '--release', + '--${_reportedDurationTestToString(flavor)}', '--no-resident', '-d', device.deviceId, test, diff --git a/dev/devicelab/manifest.yaml b/dev/devicelab/manifest.yaml index 8147fd55e9..f295e3cae7 100644 --- a/dev/devicelab/manifest.yaml +++ b/dev/devicelab/manifest.yaml @@ -353,7 +353,14 @@ tasks: image_list_reported_duration: description: > - Measures image loading performance. + Measures image loading performance on release (aot) build. + stage: devicelab + required_agent_capabilities: ["linux/android"] + flaky: true + + image_list_jit_reported_duration: + description: > + Measures image loading performance on debug (jit) build. stage: devicelab required_agent_capabilities: ["linux/android"] flaky: true