Eliminate Dart 1 benchmarks (#19430)
Flutter app development has been Dart 2 only for a significant amount of time, and we're about to remove all support for Dart 1.
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
// Copyright (c) 2017 The Chromium 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/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
await task(createHotModeTest(isPreviewDart2: false));
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright (c) 2018 The Chromium 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/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createHotModeTest(isPreviewDart2: false));
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import '../framework/utils.dart';
|
||||
final Directory _editedFlutterGalleryDir = dir(path.join(Directory.systemTemp.path, 'edited_flutter_gallery'));
|
||||
final Directory flutterGalleryDir = dir(path.join(flutterDirectory.path, 'examples/flutter_gallery'));
|
||||
|
||||
TaskFunction createHotModeTest({ bool isPreviewDart2 = true }) {
|
||||
TaskFunction createHotModeTest() {
|
||||
return () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
@@ -25,10 +25,6 @@ TaskFunction createHotModeTest({ bool isPreviewDart2 = true }) {
|
||||
final List<String> options = <String>[
|
||||
'--hot', '-d', device.deviceId, '--benchmark', '--verbose', '--resident'
|
||||
];
|
||||
if (isPreviewDart2)
|
||||
options.add('--preview-dart-2');
|
||||
else
|
||||
options.add('--no-preview-dart-2');
|
||||
setLocalEngineOptionIfNecessary(options);
|
||||
int hotReloadCount = 0;
|
||||
Map<String, dynamic> twoReloadsData;
|
||||
@@ -92,8 +88,8 @@ TaskFunction createHotModeTest({ bool isPreviewDart2 = true }) {
|
||||
}
|
||||
benchmarkFile.deleteSync();
|
||||
|
||||
// start `flutter run` again to make sure it loads from the previous state
|
||||
// (in case of --preview-dart-2 frontend loads up from previously generated kernel files).
|
||||
// Start `flutter run` again to make sure it loads from the previous
|
||||
// state. Frontend loads up from previously generated kernel files.
|
||||
{
|
||||
final Process process = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
|
||||
@@ -61,24 +61,6 @@ TaskFunction createMicrobenchmarkTask() {
|
||||
allResults.addAll(await _runMicrobench('lib/gestures/velocity_tracker_bench.dart'));
|
||||
allResults.addAll(await _runMicrobench('lib/stocks/animation_bench.dart'));
|
||||
|
||||
// Run micro-benchmarks once again in --no-preview-dart-2 mode.
|
||||
// Append "_dart1" suffix to the result keys to distinguish them from
|
||||
// the original results.
|
||||
|
||||
void addDart1Results(Map<String, double> benchmarkResults) {
|
||||
benchmarkResults.forEach((String key, double result) {
|
||||
allResults[key + '_dart1'] = result;
|
||||
});
|
||||
}
|
||||
|
||||
addDart1Results(await _runMicrobench(
|
||||
'lib/stocks/layout_bench.dart', previewDart2: false));
|
||||
addDart1Results(await _runMicrobench(
|
||||
'lib/stocks/build_bench.dart', previewDart2: false));
|
||||
addDart1Results(await _runMicrobench(
|
||||
'lib/gestures/velocity_tracker_bench.dart', previewDart2: false));
|
||||
addDart1Results(await _runMicrobench(
|
||||
'lib/stocks/animation_bench.dart', previewDart2: false));
|
||||
return new TaskResult.success(allResults, benchmarkScoreKeys: allResults.keys.toList());
|
||||
};
|
||||
}
|
||||
|
||||
@@ -214,22 +214,12 @@ class CompileTest {
|
||||
final Map<String, dynamic> metrics = <String, dynamic>{}
|
||||
..addAll(await _compileAot())
|
||||
..addAll(await _compileApp(reportPackageContentSizes: reportPackageContentSizes))
|
||||
..addAll(await _compileDebug())
|
||||
..addAll(_suffix(await _compileAot(previewDart2: false), '__dart1'))
|
||||
..addAll(_suffix(await _compileApp(previewDart2: false), '__dart1'))
|
||||
..addAll(_suffix(await _compileDebug(previewDart2: false), '__dart1'));
|
||||
..addAll(await _compileDebug());
|
||||
|
||||
return new TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList());
|
||||
});
|
||||
}
|
||||
|
||||
static Map<String, dynamic> _suffix(Map<String, dynamic> map, String suffix) {
|
||||
return new Map<String, dynamic>.fromIterables(
|
||||
map.keys.map<String>((String key) => '$key$suffix'),
|
||||
map.values,
|
||||
);
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> _compileAot({ bool previewDart2 = true }) async {
|
||||
// Generate blobs instead of assembly.
|
||||
await flutter('clean');
|
||||
|
||||
@@ -160,21 +160,6 @@ tasks:
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["mac/android"]
|
||||
|
||||
hot_mode_dev_cycle__benchmark_dart1:
|
||||
description: >
|
||||
Measures the performance of Dart VM hot patching feature under
|
||||
--no-preview-dart-2 option, that disables Dart 2.0 frontend.
|
||||
stage: devicelab
|
||||
required_agent_capabilities: ["mac/android"]
|
||||
|
||||
hot_mode_dev_cycle_ios__benchmark_dart1:
|
||||
description: >
|
||||
Measures the performance of Dart VM hot patching feature under
|
||||
--no-preview-dart-2 option, that disables Dart 2.0 frontend.
|
||||
stage: devicelab_ios
|
||||
required_agent_capabilities: ["mac/ios"]
|
||||
flaky: true
|
||||
|
||||
complex_layout_scroll_perf__memory:
|
||||
description: >
|
||||
Measures memory usage of the scroll performance test.
|
||||
|
||||
Reference in New Issue
Block a user