Add benchmark for hybrid composition on Android (#55609)

This commit is contained in:
Emmanuel Garcia
2020-04-28 19:24:15 -07:00
committed by GitHub
parent deb0fa374d
commit b176042c1a
11 changed files with 205 additions and 18 deletions

View File

@@ -0,0 +1,14 @@
// Copyright 2014 The Flutter 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/tasks/perf_tests.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createAndroidViewScrollPerfTest());
}

View File

@@ -10,5 +10,5 @@ import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createPlatformViewsScrollPerfTest());
await task(createAndroidTextureScrollPerfTest());
}

View File

@@ -10,5 +10,5 @@ import 'package:flutter_devicelab/framework/framework.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createPlatformViewsScrollPerfTest());
await task(createUiKitViewScrollPerfTest());
}

View File

@@ -30,11 +30,30 @@ TaskFunction createTilesScrollPerfTest() {
).run;
}
TaskFunction createPlatformViewsScrollPerfTest() {
TaskFunction createUiKitViewScrollPerfTest() {
return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/platform_views_layout',
'test_driver/scroll_perf.dart',
'test_driver/uikit_view_scroll_perf.dart',
'platform_views_scroll_perf',
testDriver: 'test_driver/scroll_perf_test.dart',
).run;
}
TaskFunction createAndroidTextureScrollPerfTest() {
return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/platform_views_layout',
'test_driver/android_texture_scroll_perf.dart',
'platform_views_scroll_perf',
testDriver: 'test_driver/scroll_perf_test.dart',
).run;
}
TaskFunction createAndroidViewScrollPerfTest() {
return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/platform_views_layout',
'test_driver/android_view_scroll_perf.dart',
'android_view_scroll_perf',
testDriver: 'test_driver/scroll_perf_test.dart',
).run;
}
@@ -235,15 +254,22 @@ class StartupTest {
/// performance.
class PerfTest {
const PerfTest(
this.testDirectory,
this.testTarget,
this.timelineFileName,
{this.needsMeasureCpuGPu = false});
this.testDirectory,
this.testTarget,
this.timelineFileName, {
this.needsMeasureCpuGPu = false,
this.testDriver,
});
/// The directory where the app under test is defined.
final String testDirectory;
/// The main entry-point file of the application, as run on the device.
final String testTarget;
// The prefix name of the filename such as `<timelineFileName>.timeline_summary.json`.
final String timelineFileName;
/// The test file to run on the host.
final String testDriver;
/// Whether to collect CPU and GPU metrics.
final bool needsMeasureCpuGPu;
Future<TaskResult> run() {
@@ -259,6 +285,8 @@ class PerfTest {
'--trace-startup', // Enables "endless" timeline event buffering.
'-t',
testTarget,
if (testDriver != null)
'--driver', testDriver,
'-d',
deviceId,
]);

View File

@@ -152,6 +152,12 @@ tasks:
stage: devicelab
required_agent_capabilities: ["linux/android"]
android_view_scroll_perf__timeline_summary:
description: >
Measures the runtime performance of Android views in the platform view layout sample app on Android.
stage: devicelab
required_agent_capabilities: ["linux/android"]
home_scroll_perf__timeline_summary:
description: >
Measures the runtime performance of scrolling the material page in the