benchmark memory usage for grid view of memory intensive widgets (#61025)

This commit is contained in:
Dan Field
2020-07-07 19:34:03 -07:00
committed by GitHub
parent 07e2d6f63b
commit 5969eb60ec
6 changed files with 119 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
// 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/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:flutter_devicelab/tasks/perf_tests.dart';
const String kPackageName = 'com.example.macrobenchmarks';
const String kActivityName = 'com.example.macrobenchmarks.MainActivity';
class FastScrollHeavyGridViewMemoryTest extends MemoryTest {
FastScrollHeavyGridViewMemoryTest()
: super(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_memory/heavy_gridview.dart', kPackageName,
);
@override
AndroidDevice get device => super.device as AndroidDevice;
@override
int get iterationCount => 5;
@override
Future<void> useMemory() async {
await launchApp();
await recordStart();
await device.shellExec('input', <String>['swipe', '50 1500 50 50 50']);
await Future<void>.delayed(const Duration(milliseconds: 1500));
await device.shellExec('input', <String>['swipe', '50 1500 50 50 50']);
await Future<void>.delayed(const Duration(milliseconds: 1500));
await device.shellExec('input', <String>['swipe', '50 1500 50 50 50']);
await Future<void>.delayed(const Duration(milliseconds: 1500));
await recordEnd();
}
}
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(FastScrollHeavyGridViewMemoryTest().run);
}

View File

@@ -803,6 +803,14 @@ tasks:
stage: devicelab
required_agent_capabilities: ["mac/android"]
fast_scroll_heavy_gridview__memory:
description: >
Measures memory usage for scrolling through a grid view of heavy memory
usage widgets.
stage: devicelab
required_agent_capabilities: ["linux/android"]
flaky: true
animated_placeholder_perf:
description: >
Measures frame build and rasterizer times, as well as frame build counts