From 9f285aa9d921a437978277e51e1897fd8bb0cfdf Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 8 Jul 2019 08:23:06 -0700 Subject: [PATCH] Introduce image_list performance benchmark that runs on jit(debug) build. (#35424) * Introduce image_list performance benchmark that runs on jit(debug) build. We want to track performance of debug build because ongoing work on reducing the cost of spanwing new isolate will impact jit(debug) more than it will aot(release) configurations. * Newlines and spaces --- .../image_list_jit_reported_duration.dart | 19 +++++++++++++++ .../tasks/image_list_reported_duration.dart | 1 + dev/devicelab/lib/tasks/perf_tests.dart | 23 ++++++++++++++++--- dev/devicelab/manifest.yaml | 9 +++++++- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 dev/devicelab/bin/tasks/image_list_jit_reported_duration.dart 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