From 7bef51acc979ee467c02a7503a8990a6edbb0ae3 Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Fri, 17 Jul 2020 14:34:33 -0400 Subject: [PATCH] cleanup macrobenchmark duplicate files (#61621) * cleanup macrobenchmark duplicate files --- dev/benchmarks/macrobenchmarks/README.md | 56 ++++++------------- .../test_driver/backdrop_filter_perf.dart | 11 ---- .../color_filter_and_fade_perf.dart | 11 ---- .../test_driver/cull_opacity_perf.dart | 11 ---- .../fading_child_animation_perf.dart | 11 ---- ...magefiltered_transform_animation_perf.dart | 11 ---- .../multi_widget_construction_perf.dart | 11 ---- .../test_driver/picture_cache_perf.dart | 11 ---- .../post_backdrop_filter_perf.dart | 11 ---- ...ted_placeholder_perf.dart => run_app.dart} | 0 .../test_driver/simple_animation_perf.dart | 11 ---- .../test_driver/textfield_perf.dart | 11 ---- dev/devicelab/lib/tasks/perf_tests.dart | 46 +++++++++------ 13 files changed, 45 insertions(+), 167 deletions(-) delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/backdrop_filter_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/color_filter_and_fade_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/fading_child_animation_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/imagefiltered_transform_animation_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/post_backdrop_filter_perf.dart rename dev/benchmarks/macrobenchmarks/test_driver/{animated_placeholder_perf.dart => run_app.dart} (100%) delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/simple_animation_perf.dart delete mode 100644 dev/benchmarks/macrobenchmarks/test_driver/textfield_perf.dart diff --git a/dev/benchmarks/macrobenchmarks/README.md b/dev/benchmarks/macrobenchmarks/README.md index 2e2c4a07c1c..401c2bffe2e 100644 --- a/dev/benchmarks/macrobenchmarks/README.md +++ b/dev/benchmarks/macrobenchmarks/README.md @@ -4,53 +4,29 @@ Performance benchmarks use either flutter drive or the web benchmark harness. ## Mobile benchmarks -### Cull opacity benchmark - -To run the cull opacity benchmark on a device: +To run a mobile benchmark on a device: ``` -flutter drive --profile test_driver/cull_opacity_perf.dart +flutter drive --profile -t test_driver/run_app.dart --driver test_driver/[test_name]_test.dart ``` -Results should be in the file `build/cull_opacity_perf.timeline_summary.json`. +Results should be in the file `build/[test_name].timeline_summary.json`. -More detailed logs should be in `build/cull_opacity_perf.timeline.json`. +More detailed logs should be in `build/[test_name].timeline.json`. -### Cubic bezier benchmark +The key `[test_name]` can be: -To run the cubic bezier benchmark on a device: - -``` -flutter drive --profile test_driver/cubic_bezier_perf.dart -``` - -Results should be in the file `build/cubic_bezier_perf.timeline_summary.json`. - -More detailed logs should be in `build/cubic_bezier_perf.timeline.json`. - -### Backdrop filter benchmark - -To run the backdrop filter benchmark on a device: - -``` -flutter drive --profile test_driver/backdrop_filter_perf.dart -``` - -Results should be in the file `build/backdrop_filter_perf.timeline_summary.json`. - -More detailed logs should be in `build/backdrop_filter_perf.timeline.json`. - -### Post Backdrop filter benchmark - -To run the post-backdrop filter benchmark on a device: - -``` -flutter drive --profile test_driver/post_backdrop_filter_perf.dart -``` - -Results should be in the file `build/post_backdrop_filter_perf.timeline_summary.json`. - -More detailed logs should be in `build/post_backdrop_filter_perf.timeline.json`. +- `animated_placeholder_perf` +- `backdrop_filter_perf` +- `cull_opacity_perf` +- `fading_child_animation_perf` +- `imagefiltered_transform_animation_perf` +- `multi_widget_construction_perf` +- `picture_cache_perf` +- `post_backdrop_filter_perf` +- `simple_animation_perf` +- `textfield_perf` +- `cubic_bezier_perf` ## Web benchmarks diff --git a/dev/benchmarks/macrobenchmarks/test_driver/backdrop_filter_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/backdrop_filter_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/backdrop_filter_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/color_filter_and_fade_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/color_filter_and_fade_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/color_filter_and_fade_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/fading_child_animation_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/fading_child_animation_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/fading_child_animation_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/imagefiltered_transform_animation_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/imagefiltered_transform_animation_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/imagefiltered_transform_animation_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/post_backdrop_filter_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/post_backdrop_filter_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/post_backdrop_filter_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/animated_placeholder_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/run_app.dart similarity index 100% rename from dev/benchmarks/macrobenchmarks/test_driver/animated_placeholder_perf.dart rename to dev/benchmarks/macrobenchmarks/test_driver/run_app.dart diff --git a/dev/benchmarks/macrobenchmarks/test_driver/simple_animation_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/simple_animation_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/simple_animation_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/benchmarks/macrobenchmarks/test_driver/textfield_perf.dart b/dev/benchmarks/macrobenchmarks/test_driver/textfield_perf.dart deleted file mode 100644 index 8169d132b69..00000000000 --- a/dev/benchmarks/macrobenchmarks/test_driver/textfield_perf.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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/driver_extension.dart'; -import 'package:macrobenchmarks/main.dart' as app; - -void main() { - enableFlutterDriverExtension(); - app.main(); -} diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index d01778091b9..9088e849fea 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -7,14 +7,14 @@ import 'dart:convert' show LineSplitter, json, utf8; import 'dart:io'; import 'dart:math' as math; -import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart'; import 'package:meta/meta.dart'; import 'package:path/path.dart' as path; -import '../framework/adb.dart'; -import '../framework/framework.dart'; -import '../framework/ios.dart'; -import '../framework/utils.dart'; +import 'package:flutter_devicelab/framework/adb.dart'; +import 'package:flutter_devicelab/framework/framework.dart'; +import 'package:flutter_devicelab/framework/ios.dart'; +import 'package:flutter_devicelab/framework/utils.dart'; +import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart'; TaskFunction createComplexLayoutScrollPerfTest() { return PerfTest( @@ -70,16 +70,18 @@ TaskFunction createHomeScrollPerfTest() { TaskFunction createCullOpacityPerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/cull_opacity_perf.dart', + 'test_driver/run_app.dart', 'cull_opacity_perf', + testDriver: 'test_driver/cull_opacity_perf_test.dart', ).run; } TaskFunction createCubicBezierPerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/cubic_bezier_perf.dart', + 'test_driver/run_app.dart', 'cubic_bezier_perf', + testDriver: 'test_driver/cubic_bezier_perf_test.dart', ).run; } @@ -102,44 +104,49 @@ TaskFunction createFlutterGalleryTransitionsPerfSkSLWarmupTest() { TaskFunction createBackdropFilterPerfTest({bool needsMeasureCpuGpu = false}) { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/backdrop_filter_perf.dart', + 'test_driver/run_app.dart', 'backdrop_filter_perf', needsMeasureCpuGpu: needsMeasureCpuGpu, + testDriver: 'test_driver/backdrop_filter_perf_test.dart', ).run; } TaskFunction createPostBackdropFilterPerfTest({bool needsMeasureCpuGpu = false}) { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/post_backdrop_filter_perf.dart', + 'test_driver/run_app.dart', 'post_backdrop_filter_perf', needsMeasureCpuGpu: needsMeasureCpuGpu, + testDriver: 'test_driver/post_backdrop_filter_perf_test.dart', ).run; } TaskFunction createSimpleAnimationPerfTest({bool needsMeasureCpuGpu = false}) { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/simple_animation_perf.dart', + 'test_driver/run_app.dart', 'simple_animation_perf', needsMeasureCpuGpu: needsMeasureCpuGpu, + testDriver: 'test_driver/simple_animation_perf_test.dart', ).run; } TaskFunction createAnimatedPlaceholderPerfTest({bool needsMeasureCpuGpu = false}) { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/animated_placeholder_perf.dart', + 'test_driver/run_app.dart', 'animated_placeholder_perf', needsMeasureCpuGpu: needsMeasureCpuGpu, + testDriver: 'test_driver/animated_placeholder_perf_test.dart', ).run; } TaskFunction createPictureCachePerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/picture_cache_perf.dart', + 'test_driver/run_app.dart', 'picture_cache_perf', + testDriver: 'test_driver/picture_cache_perf_test.dart', ).run; } @@ -213,40 +220,45 @@ TaskFunction createBasicMaterialCompileTest() { TaskFunction createTextfieldPerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/textfield_perf.dart', + 'test_driver/run_app.dart', 'textfield_perf', + testDriver: 'test_driver/textfield_perf_test.dart', ).run; } TaskFunction createColorFilterAndFadePerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/color_filter_and_fade_perf.dart', + 'test_driver/run_app.dart', 'color_filter_and_fade_perf', + testDriver: 'test_driver/color_filter_and_fade_perf_test.dart', ).run; } TaskFunction createFadingChildAnimationPerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/fading_child_animation_perf.dart', + 'test_driver/run_app.dart', 'fading_child_animation_perf', + testDriver: 'test_driver/fading_child_animation_perf_test.dart', ).run; } TaskFunction createImageFilteredTransformAnimationPerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/imagefiltered_transform_animation_perf.dart', + 'test_driver/run_app.dart', 'imagefiltered_transform_animation_perf', + testDriver: 'test_driver/imagefiltered_transform_animation_perf_test.dart', ).run; } TaskFunction createsMultiWidgetConstructPerfTest() { return PerfTest( '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', - 'test_driver/multi_widget_construction_perf.dart', + 'test_driver/run_app.dart', 'multi_widget_construction_perf', + testDriver: 'test_driver/multi_widget_construction_perf_test.dart', ).run; }