From 67810d672be8b14e438a4bc50d5689a4a2567108 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 21 Mar 2023 15:52:18 -0700 Subject: [PATCH] delete sksl benchmarks (#123163) delete sksl benchmarks --- .ci.yaml | 10 -- ...lery_ios_sksl_warmup__transition_perf.dart | 12 -- dev/devicelab/lib/tasks/perf_tests.dart | 156 ------------------ 3 files changed, 178 deletions(-) delete mode 100644 dev/devicelab/bin/tasks/flutter_gallery_ios_sksl_warmup__transition_perf.dart diff --git a/.ci.yaml b/.ci.yaml index 9cc2bd81440..f403d2d8433 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -4042,16 +4042,6 @@ targets: ["devicelab", "ios", "mac"] task_name: flutter_gallery__transition_perf_e2e_impeller_ios - - name: Mac_ios flutter_gallery_ios_sksl_warmup__transition_perf - bringup: true # Flaky https://github.com/flutter/flutter/issues/121231 - recipe: devicelab/devicelab_drone - presubmit: false - timeout: 60 - properties: - tags: > - ["devicelab", "ios", "mac"] - task_name: flutter_gallery_ios_sksl_warmup__transition_perf - - name: Mac_ios spell_check_test recipe: devicelab/devicelab_drone presubmit: false diff --git a/dev/devicelab/bin/tasks/flutter_gallery_ios_sksl_warmup__transition_perf.dart b/dev/devicelab/bin/tasks/flutter_gallery_ios_sksl_warmup__transition_perf.dart deleted file mode 100644 index 1aecaa396a2..00000000000 --- a/dev/devicelab/bin/tasks/flutter_gallery_ios_sksl_warmup__transition_perf.dart +++ /dev/null @@ -1,12 +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_devicelab/framework/devices.dart'; -import 'package:flutter_devicelab/framework/framework.dart'; -import 'package:flutter_devicelab/tasks/perf_tests.dart'; - -Future main() async { - deviceOperatingSystem = DeviceOperatingSystem.ios; - await task(createFlutterGalleryTransitionsPerfSkSLWarmupTest()); -} diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index 88fd1bdb822..9a4206eda60 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -128,14 +128,6 @@ TaskFunction createCubicBezierPerfE2ETest() { ).run; } -TaskFunction createFlutterGalleryTransitionsPerfSkSLWarmupTest() { - return PerfTestWithSkSL( - '${flutterDirectory.path}/dev/integration_tests/flutter_gallery', - 'test_driver/transitions_perf.dart', - 'transitions', - ).run; -} - TaskFunction createBackdropFilterPerfTest({ bool measureCpuGpu = true, bool enableImpeller = false, @@ -1025,9 +1017,7 @@ class PerfTest { @protected Future internalRun({ - bool cacheSkSL = false, String? existingApp, - String? writeSkslFileName, }) { return inDirectory(testDirectory, () async { late Device selectedDevice; @@ -1063,9 +1053,6 @@ class PerfTest { ...['--driver', testDriver!], if (existingApp != null) ...['--use-existing-app', existingApp], - if (writeSkslFileName != null) - ...['--write-sksl-on-exit', writeSkslFileName], - if (cacheSkSL) '--cache-sksl', if (dartDefine.isNotEmpty) ...['--dart-define', dartDefine], if (enableImpeller) '--enable-impeller', @@ -1154,149 +1141,6 @@ const List _kCommonScoreKeys = [ 'old_gen_gc_count', ]; -class PerfTestWithSkSL extends PerfTest { - PerfTestWithSkSL( - super.testDirectory, - super.testTarget, - String super.timelineFileName, { - super.measureCpuGpu = false, - super.testDriver, - super.needsFullTimeline, - super.benchmarkScoreKeys, - }); - - - PerfTestWithSkSL.e2e( - super.testDirectory, - super.testTarget, { - String super.testDriver, - super.resultFilename, - }) : super.e2e( - needsFullTimeline: false, - ); - - @override - Future run({int? timeoutSeconds}) async { - return inDirectory(testDirectory, () async { - // Some initializations - _device = await devices.workingDevice; - _flutterPath = path.join(flutterDirectory.path, 'bin', 'flutter'); - - // Prepare the SkSL by running the driver test. - await _generateSkSL(); - - // Build the app with SkSL artifacts and run that app - final String vmServiceUri = await _runApp(skslPath: _skslJsonFileName); - - // Attach to the running app and run the final driver test to get metrics. - final TaskResult result = await internalRun( - existingApp: vmServiceUri, - ); - - _runProcess.kill(); - await _runProcess.exitCode; - - return result; - }); - } - - Future _generateSkSL() async { - // `flutter drive` without `flutter run`, and `flutter drive --existing-app` - // with `flutter run` may generate different SkSLs. Hence we run both - // versions to generate as many SkSLs as possible. - // - // 1st, `flutter drive --existing-app` with `flutter run`. The - // `--write-sksl-on-exit` option doesn't seem to be compatible with - // `flutter drive --existing-app` as it will complain web socket connection - // issues. - final String vmServiceUri = await _runApp(cacheSkSL: true); - await super.internalRun(cacheSkSL: true, existingApp: vmServiceUri); - _runProcess.kill(); - await _runProcess.exitCode; - - // 2nd, `flutter drive` without `flutter run`. The --no-build option ensures - // that we won't remove the SkSLs generated earlier. - await super.internalRun( - cacheSkSL: true, - writeSkslFileName: _skslJsonFileName, - ); - } - - Future _runApp({String? appBinary, bool cacheSkSL = false, String? skslPath}) async { - if (File(_vmserviceFileName).existsSync()) { - File(_vmserviceFileName).deleteSync(); - } - final String? localEngine = localEngineFromEnv; - final String? localEngineSrcPath = localEngineSrcPathFromEnv; - _runProcess = await startProcess( - _flutterPath, - [ - 'run', - if (localEngine != null) - ...['--local-engine', localEngine], - if (localEngineSrcPath != null) - ...['--local-engine-src-path', localEngineSrcPath], - '--no-dds', - if (deviceOperatingSystem == DeviceOperatingSystem.ios) - ...[ - '--device-timeout', '5', - ], - '--verbose', - '--verbose-system-logs', - '--purge-persistent-cache', - '--no-publish-port', - '--profile', - if (skslPath != null) '--bundle-sksl-path=$skslPath', - if (cacheSkSL) '--cache-sksl', - '-d', _device.deviceId, - '-t', testTarget, - '--endless-trace-buffer', - if (appBinary != null) ...['--use-application-binary', _appBinary], - '--vmservice-out-file', _vmserviceFileName, - ], - ); - - final Stream> broadcastOut = _runProcess.stdout.asBroadcastStream(); - _forwardStream(broadcastOut, 'run stdout'); - _forwardStream(_runProcess.stderr, 'run stderr'); - - final File file = await waitForFile(_vmserviceFileName); - return file.readAsStringSync(); - } - - String get _skslJsonFileName => '$testDirectory/flutter_01.sksl.json'; - String get _vmserviceFileName => '$testDirectory/$_kVmserviceOutFileName'; - - bool get _isAndroid => deviceOperatingSystem == DeviceOperatingSystem.android; - - String get _appBinary { - if (_isAndroid) { - return '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk'; - } - for (final FileSystemEntity entry in Directory('$testDirectory/build/ios/iphoneos/').listSync()) { - if (entry.path.endsWith('.app')) { - return entry.path; - } - } - throw 'No app found.'; - } - - Stream _transform(Stream> stream) => - stream.transform(utf8.decoder).transform(const LineSplitter()); - - void _forwardStream(Stream> stream, String label) { - _transform(stream).listen((String line) { - print('$label: $line'); - }); - } - - late String _flutterPath; - late Device _device; - late Process _runProcess; - - static const String _kVmserviceOutFileName = 'vmservice.out'; -} - /// Measures how long it takes to compile a Flutter app to JavaScript and how /// big the compiled code is. class WebCompileTest {