Unverified Commit ee204880 authored by Jim Graham's avatar Jim Graham Committed by GitHub

Opacity Peephole optimization benchmarks (#94447)

parent fff85f9c
...@@ -1863,6 +1863,56 @@ targets: ...@@ -1863,6 +1863,56 @@ targets:
timeout: 60 timeout: 60
scheduler: luci scheduler: luci
- name: Linux_android opacity_peephole_one_rect_perf__e2e_summary
recipe: devicelab/devicelab_drone
presubmit: false
timeout: 60
properties:
tags: >
["devicelab","android","linux"]
task_name: opacity_peephole_one_rect_perf__e2e_summary
scheduler: luci
- name: Linux_android opacity_peephole_col_of_rows_perf__e2e_summary
recipe: devicelab/devicelab_drone
presubmit: false
timeout: 60
properties:
tags: >
["devicelab","android","linux"]
task_name: opacity_peephole_col_of_rows_perf__e2e_summary
scheduler: luci
- name: Linux_android opacity_peephole_opacity_of_grid_perf__e2e_summary
recipe: devicelab/devicelab_drone
presubmit: false
timeout: 60
properties:
tags: >
["devicelab","android","linux"]
task_name: opacity_peephole_opacity_of_grid_perf__e2e_summary
scheduler: luci
- name: Linux_android opacity_peephole_grid_of_opacity_perf__e2e_summary
recipe: devicelab/devicelab_drone
presubmit: false
timeout: 60
properties:
tags: >
["devicelab","android","linux"]
task_name: opacity_peephole_grid_of_opacity_perf__e2e_summary
scheduler: luci
- name: Linux_android opacity_peephole_fade_transition_text_perf__e2e_summary
recipe: devicelab/devicelab_drone
presubmit: false
timeout: 60
properties:
tags: >
["devicelab","android","linux"]
task_name: opacity_peephole_fade_transition_text_perf__e2e_summary
scheduler: luci
- name: Mac build_aar_module_test - name: Mac build_aar_module_test
recipe: devicelab/devicelab_drone recipe: devicelab/devicelab_drone
timeout: 60 timeout: 60
......
...@@ -61,6 +61,11 @@ ...@@ -61,6 +61,11 @@
/dev/devicelab/bin/tasks/routing_test.dart @zanderso @flutter/tool /dev/devicelab/bin/tasks/routing_test.dart @zanderso @flutter/tool
/dev/devicelab/bin/tasks/textfield_perf__e2e_summary.dart @zanderso @flutter/engine /dev/devicelab/bin/tasks/textfield_perf__e2e_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/web_size__compile_test.dart @yjbanov @flutter/web /dev/devicelab/bin/tasks/web_size__compile_test.dart @yjbanov @flutter/web
/dev/devicelab/bin/tasks/opacity_peephole_col_of_rows_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_grid_of_opacity_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_one_rect_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_opacity_of_grid_perf__e2e_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/opacity_peephole_fade_transition_text_perf__e2e_summary.dart @flar @flutter/engine
## Windows Android DeviceLab tests ## Windows Android DeviceLab tests
/dev/devicelab/bin/tasks/basic_material_app_win__compile.dart @zanderso @flutter/tool /dev/devicelab/bin/tasks/basic_material_app_win__compile.dart @zanderso @flutter/tool
......
...@@ -22,6 +22,16 @@ const String kSimpleScrollRouteName = '/simple_scroll'; ...@@ -22,6 +22,16 @@ const String kSimpleScrollRouteName = '/simple_scroll';
const String kStackSizeRouteName = '/stack_size'; const String kStackSizeRouteName = '/stack_size';
const String kAnimationWithMicrotasksRouteName = '/animation_with_microtasks'; const String kAnimationWithMicrotasksRouteName = '/animation_with_microtasks';
const String kAnimatedImageRouteName = '/animated_image'; const String kAnimatedImageRouteName = '/animated_image';
const String kOpacityPeepholeRouteName = '/opacity_peephole';
const String kOpacityPeepholeOneRectRouteName = '$kOpacityPeepholeRouteName/one_big_rect';
const String kOpacityPeepholeColumnOfOpacityRouteName = '$kOpacityPeepholeRouteName/column_of_opacity';
const String kOpacityPeepholeOpacityOfCachedChildRouteName = '$kOpacityPeepholeRouteName/opacity_of_cached_child';
const String kOpacityPeepholeOpacityOfColumnRouteName = '$kOpacityPeepholeRouteName/opacity_of_column';
const String kOpacityPeepholeGridOfOpacityRouteName = '$kOpacityPeepholeRouteName/grid_of_opacity';
const String kOpacityPeepholeOpacityOfGridRouteName = '$kOpacityPeepholeRouteName/opacity_of_grid';
const String kOpacityPeepholeOpacityOfColOfRowsRouteName = '$kOpacityPeepholeRouteName/opacity_of_col_of_rows';
const String kOpacityPeepholeFadeTransitionTextRouteName = '$kOpacityPeepholeRouteName/fade_transition_text';
const String kScrollableName = '/macrobenchmark_listview'; const String kScrollableName = '/macrobenchmark_listview';
......
...@@ -19,6 +19,7 @@ import 'src/heavy_grid_view.dart'; ...@@ -19,6 +19,7 @@ import 'src/heavy_grid_view.dart';
import 'src/large_image_changer.dart'; import 'src/large_image_changer.dart';
import 'src/large_images.dart'; import 'src/large_images.dart';
import 'src/multi_widget_construction.dart'; import 'src/multi_widget_construction.dart';
import 'src/opacity_peephole.dart';
import 'src/picture_cache.dart'; import 'src/picture_cache.dart';
import 'src/post_backdrop_filter.dart'; import 'src/post_backdrop_filter.dart';
import 'src/simple_animation.dart'; import 'src/simple_animation.dart';
...@@ -60,6 +61,8 @@ class MacrobenchmarksApp extends StatelessWidget { ...@@ -60,6 +61,8 @@ class MacrobenchmarksApp extends StatelessWidget {
kStackSizeRouteName: (BuildContext context) => const StackSizePage(), kStackSizeRouteName: (BuildContext context) => const StackSizePage(),
kAnimationWithMicrotasksRouteName: (BuildContext context) => const AnimationWithMicrotasks(), kAnimationWithMicrotasksRouteName: (BuildContext context) => const AnimationWithMicrotasks(),
kAnimatedImageRouteName: (BuildContext context) => const AnimatedImagePage(), kAnimatedImageRouteName: (BuildContext context) => const AnimatedImagePage(),
kOpacityPeepholeRouteName: (BuildContext context) => const OpacityPeepholePage(),
...opacityPeepholeRoutes,
}, },
); );
} }
...@@ -210,6 +213,13 @@ class HomePage extends StatelessWidget { ...@@ -210,6 +213,13 @@ class HomePage extends StatelessWidget {
Navigator.pushNamed(context, kAnimatedImageRouteName); Navigator.pushNamed(context, kAnimatedImageRouteName);
}, },
), ),
ElevatedButton(
key: const Key(kOpacityPeepholeRouteName),
child: const Text('Opacity Peephole tests'),
onPressed: () {
Navigator.pushNamed(context, kOpacityPeepholeRouteName);
},
),
], ],
), ),
); );
......
This diff is collapsed.
// 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 'package:macrobenchmarks/common.dart';
import 'util.dart';
void main() {
macroPerfTestE2E(
'opacity_peephole_col_of_rows_perf',
kOpacityPeepholeOpacityOfColOfRowsRouteName,
pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10),
);
}
// 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 'package:macrobenchmarks/common.dart';
import 'util.dart';
void main() {
macroPerfTestE2E(
'opacity_peephole_fade_transition_text_perf',
kOpacityPeepholeFadeTransitionTextRouteName,
pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10),
);
}
// 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 'package:macrobenchmarks/common.dart';
import 'util.dart';
void main() {
macroPerfTestE2E(
'opacity_peephole_grid_of_opacity_perf',
kOpacityPeepholeGridOfOpacityRouteName,
pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10),
);
}
// 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 'package:macrobenchmarks/common.dart';
import 'util.dart';
void main() {
macroPerfTestE2E(
'opacity_peephole_one_rect_perf',
kOpacityPeepholeOneRectRouteName,
pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10),
);
}
// 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 'package:macrobenchmarks/common.dart';
import 'util.dart';
void main() {
macroPerfTestE2E(
'opacity_peephole_opacity_of_grid_perf',
kOpacityPeepholeOpacityOfGridRouteName,
pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10),
);
}
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart'; import 'package:integration_test/integration_test.dart';
import 'package:macrobenchmarks/common.dart';
import 'package:macrobenchmarks/main.dart' as app; import 'package:macrobenchmarks/main.dart' as app;
typedef ControlCallback = Future<void> Function(WidgetController controller); typedef ControlCallback = Future<void> Function(WidgetController controller);
...@@ -34,17 +33,21 @@ void macroPerfTestE2E( ...@@ -34,17 +33,21 @@ void macroPerfTestE2E(
// See: https://github.com/flutter/flutter/issues/19434 // See: https://github.com/flutter/flutter/issues/19434
await tester.binding.delayed(const Duration(microseconds: 250)); await tester.binding.delayed(const Duration(microseconds: 250));
final Finder scrollable = expect(routeName, startsWith('/'));
find.byKey(const ValueKey<String>(kScrollableName)); int i = 0;
expect(scrollable, findsOneWidget); while (i < routeName.length) {
final Finder button = i = routeName.indexOf('/', i + 1);
find.byKey(ValueKey<String>(routeName), skipOffstage: false); if (i < 0) {
await tester.scrollUntilVisible(button, 50); i = routeName.length;
expect(button, findsOneWidget); }
await tester.pumpAndSettle(); final Finder button = find.byKey(ValueKey<String>(routeName.substring(0, i)), skipOffstage: false);
await tester.tap(button); await tester.scrollUntilVisible(button, 50);
// Cannot be pumpAndSettle because some tests have infinite animation. expect(button, findsOneWidget);
await tester.pump(const Duration(milliseconds: 20)); await tester.pumpAndSettle();
await tester.tap(button);
// Cannot be pumpAndSettle because some tests have infinite animation.
await tester.pump(const Duration(milliseconds: 20));
}
if (pageDelay != null) { if (pageDelay != null) {
// Wait for the page to load // Wait for the page to load
......
// 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(createOpacityPeepholeColOfRowsPerfE2ETest());
}
// 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(createOpacityPeepholeFadeTransitionTextPerfE2ETest());
}
// 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(createOpacityPeepholeGridOfOpacityPerfE2ETest());
}
// 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(createOpacityPeepholeOneRectPerfE2ETest());
}
// 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(createOpacityPeepholeOpacityOfGridPerfE2ETest());
}
...@@ -484,6 +484,41 @@ TaskFunction createFramePolicyIntegrationTest() { ...@@ -484,6 +484,41 @@ TaskFunction createFramePolicyIntegrationTest() {
}; };
} }
TaskFunction createOpacityPeepholeOneRectPerfE2ETest() {
return PerfTest.e2e(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test/opacity_peephole_one_rect_perf_e2e.dart',
).run;
}
TaskFunction createOpacityPeepholeColOfRowsPerfE2ETest() {
return PerfTest.e2e(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test/opacity_peephole_col_of_rows_perf_e2e.dart',
).run;
}
TaskFunction createOpacityPeepholeOpacityOfGridPerfE2ETest() {
return PerfTest.e2e(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test/opacity_peephole_opacity_of_grid_perf_e2e.dart',
).run;
}
TaskFunction createOpacityPeepholeGridOfOpacityPerfE2ETest() {
return PerfTest.e2e(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test/opacity_peephole_grid_of_opacity_perf_e2e.dart',
).run;
}
TaskFunction createOpacityPeepholeFadeTransitionTextPerfE2ETest() {
return PerfTest.e2e(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test/opacity_peephole_fade_transition_text_perf_e2e.dart',
).run;
}
Map<String, dynamic> _average(List<Map<String, dynamic>> results, int iterations) { Map<String, dynamic> _average(List<Map<String, dynamic>> results, int iterations) {
final Map<String, dynamic> tally = <String, dynamic>{}; final Map<String, dynamic> tally = <String, dynamic>{};
for (final Map<String, dynamic> item in results) { for (final Map<String, dynamic> item in results) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment