Add benchmarks to measure impact of alpha saveLayers in DisplayLists (#97336)

This commit is contained in:
Jim Graham
2022-01-27 13:25:17 -08:00
committed by GitHub
parent 0c9d24f58c
commit 9c934041bd
9 changed files with 234 additions and 0 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/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/perf_tests.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createOpacityPeepholeColOfAlphaSaveLayerRowsPerfE2ETest());
}

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/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/perf_tests.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createOpacityPeepholeGridOfAlphaSaveLayersPerfE2ETest());
}

View File

@@ -519,6 +519,20 @@ TaskFunction createOpacityPeepholeFadeTransitionTextPerfE2ETest() {
).run;
}
TaskFunction createOpacityPeepholeGridOfAlphaSaveLayersPerfE2ETest() {
return PerfTest.e2e(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test/opacity_peephole_grid_of_alpha_savelayers_perf_e2e.dart',
).run;
}
TaskFunction createOpacityPeepholeColOfAlphaSaveLayerRowsPerfE2ETest() {
return PerfTest.e2e(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test/opacity_peephole_col_of_alpha_savelayer_rows_perf_e2e.dart',
).run;
}
Map<String, dynamic> _average(List<Map<String, dynamic>> results, int iterations) {
final Map<String, dynamic> tally = <String, dynamic>{};
for (final Map<String, dynamic> item in results) {