Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,17 @@ targets:
task_name: picture_cache_perf__timeline_summary
scheduler: luci

- name: Linux_android picture_cache_complexity_scoring_perf__timeline_summary
Comment thread
gw280 marked this conversation as resolved.
Comment thread
gw280 marked this conversation as resolved.
recipe: devicelab/devicelab_drone
bringup: true
presubmit: false
timeout: 60
properties:
tags: >
["devicelab","android","linux"]
task_name: picture_cache_complexity_scoring_perf__timeline_summary
scheduler: luci

- name: Linux_android platform_channels_benchmarks
recipe: devicelab/devicelab_drone
presubmit: false
Expand Down Expand Up @@ -3391,6 +3402,17 @@ targets:
task_name: new_gallery_ios__transition_perf
scheduler: luci

- name: Mac_ios picture_cache_complexity_scoring_perf__timeline_summary
Comment thread
gw280 marked this conversation as resolved.
recipe: devicelab/devicelab_drone
bringup: true
presubmit: false
timeout: 60
properties:
tags: >
["devicelab","ios","mac"]
task_name: picture_cache_complexity_scoring_perf__timeline_summary
scheduler: luci

- name: Mac_ios platform_channel_sample_test_ios
recipe: devicelab/devicelab_drone
presubmit: false
Expand Down
1 change: 1 addition & 0 deletions TESTOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
/dev/devicelab/bin/tasks/microbenchmarks.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/new_gallery__transition_perf.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/picture_cache_perf__timeline_summary.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/picture_cache_complexity_scoring_perf__timeline_summary.dart @flar @flutter/engine
/dev/devicelab/bin/tasks/platform_channel_sample_test.dart @zanderso @flutter/engine
/dev/devicelab/bin/tasks/platform_interaction_test.dart @stuartmorgan @flutter/plugin
/dev/devicelab/bin/tasks/platform_view__start_up.dart @zanderso @flutter/engine
Expand Down
1 change: 1 addition & 0 deletions dev/benchmarks/macrobenchmarks/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const String kBackdropFilterRouteName = '/backdrop_filter';
const String kPostBackdropFilterRouteName = '/post_backdrop_filter';
const String kSimpleAnimationRouteName = '/simple_animation';
const String kPictureCacheRouteName = '/picture_cache';
const String kPictureCacheComplexityScoringRouteName = '/picture_cache_complexity_scoring';
const String kLargeImageChangerRouteName = '/large_image_changer';
const String kLargeImagesRouteName = '/large_images';
const String kTextRouteName = '/text';
Expand Down
9 changes: 9 additions & 0 deletions dev/benchmarks/macrobenchmarks/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'src/large_images.dart';
import 'src/multi_widget_construction.dart';
import 'src/opacity_peephole.dart';
import 'src/picture_cache.dart';
import 'src/picture_cache_complexity_scoring.dart';
import 'src/post_backdrop_filter.dart';
import 'src/simple_animation.dart';
import 'src/simple_scroll.dart';
Expand All @@ -47,6 +48,7 @@ class MacrobenchmarksApp extends StatelessWidget {
kPostBackdropFilterRouteName: (BuildContext context) => const PostBackdropFilterPage(),
kSimpleAnimationRouteName: (BuildContext context) => const SimpleAnimationPage(),
kPictureCacheRouteName: (BuildContext context) => const PictureCachePage(),
kPictureCacheComplexityScoringRouteName: (BuildContext context) => const PictureCacheComplexityScoringPage(),
kLargeImageChangerRouteName: (BuildContext context) => const LargeImageChangerPage(),
kLargeImagesRouteName: (BuildContext context) => const LargeImagesPage(),
kTextRouteName: (BuildContext context) => const TextPage(),
Expand Down Expand Up @@ -122,6 +124,13 @@ class HomePage extends StatelessWidget {
Navigator.pushNamed(context, kPictureCacheRouteName);
},
),
ElevatedButton(
key: const Key(kPictureCacheComplexityScoringRouteName),
child: const Text('Picture Cache Complexity Scoring'),
onPressed: () {
Navigator.pushNamed(context, kPictureCacheComplexityScoringRouteName);
},
),
ElevatedButton(
key: const Key(kLargeImagesRouteName),
child: const Text('Large Images'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// 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:flutter/material.dart';

class PictureCacheComplexityScoringPage extends StatelessWidget {
const PictureCacheComplexityScoringPage({Key? key}) : super(key: key);

static const List<String> kTabNames = <String>['1', '2'];

@override
Widget build(BuildContext context) {
return DefaultTabController(
length: kTabNames.length, // This is the number of tabs.
child: Scaffold(
appBar: AppBar(
title: const Text('Picture Cache Complexity Scoring'),
// pinned: true,
// expandedHeight: 50.0,
// forceElevated: innerBoxIsScrolled,
bottom: TabBar(
tabs: kTabNames.map((String name) => Tab(text: name)).toList(),
),
),
body: TabBarView(
key: const Key('tabbar_view_complexity'), // this key is used by the driver test
children: kTabNames.map((String name) {
return _buildComplexityScoringWidgets(name);
}).toList(),
),
),
);
}

// For now we just test a single case where the widget being cached is actually
// relatively cheap to rasterise, and so should not be in the cache.
//
// Eventually we can extend this to add new test cases based on the tab name.
Widget _buildComplexityScoringWidgets(String name) {
return Column(children: <Widget>[
Slider(value: 50, label: 'Slider 1', onChanged: (double _) {}, max: 100, divisions: 10,),
Slider(value: 50, label: 'Slider 2', onChanged: (double _) {}, max: 100, divisions: 10,),
Slider(value: 50, label: 'Slider 3', onChanged: (double _) {}, max: 100, divisions: 10,),
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 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:flutter_driver/flutter_driver.dart';
import 'package:macrobenchmarks/common.dart';

import 'util.dart';

void main() {
macroPerfTest(
'picture_cache_complexity_scoring_perf',
kPictureCacheComplexityScoringRouteName,
pageDelay: const Duration(seconds: 1),
driverOps: (FlutterDriver driver) async {
final SerializableFinder tabBarView = find.byValueKey('tabbar_view_complexity');
Future<void> _scrollOnce(double offset) async {
// Technically it's not scrolling but moving
await driver.scroll(tabBarView, offset, 0.0, const Duration(milliseconds: 300));
await Future<void>.delayed(const Duration(milliseconds: 500));
}
// When we eventually add more test panes we will want to tweak these
// to go through all the panes
for (int i = 0; i < 6; i += 1) {
await _scrollOnce(-300.0);
await _scrollOnce(300.0);
}
},
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 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: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(createPictureCacheComplexityScoringPerfTest());
}
9 changes: 9 additions & 0 deletions dev/devicelab/lib/tasks/perf_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ TaskFunction createPictureCachePerfE2ETest() {
).run;
}

TaskFunction createPictureCacheComplexityScoringPerfTest() {
return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/run_app.dart',
'picture_cache_complexity_scoring_perf',
testDriver: 'test_driver/picture_cache_complexity_scoring_perf_test.dart',
).run;
}

TaskFunction createFlutterGalleryStartupTest({String target = 'lib/main.dart'}) {
return StartupTest(
'${flutterDirectory.path}/dev/integration_tests/flutter_gallery',
Expand Down