mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[benchmarks] remove archived build aot benchmarks (#52283)
This commit is contained in:
parent
3191af1332
commit
4ce34f2516
@ -362,7 +362,6 @@ class CompileTest {
|
|||||||
await flutter('packages', options: <String>['get']);
|
await flutter('packages', options: <String>['get']);
|
||||||
|
|
||||||
final Map<String, dynamic> metrics = <String, dynamic>{
|
final Map<String, dynamic> metrics = <String, dynamic>{
|
||||||
...await _compileAot(),
|
|
||||||
...await _compileApp(reportPackageContentSizes: reportPackageContentSizes),
|
...await _compileApp(reportPackageContentSizes: reportPackageContentSizes),
|
||||||
...await _compileDebug(),
|
...await _compileDebug(),
|
||||||
};
|
};
|
||||||
@ -371,43 +370,6 @@ class CompileTest {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> _compileAot() async {
|
|
||||||
await flutter('clean');
|
|
||||||
final Stopwatch watch = Stopwatch()..start();
|
|
||||||
final List<String> options = <String>[
|
|
||||||
'aot',
|
|
||||||
'-v',
|
|
||||||
'--extra-gen-snapshot-options=--print_snapshot_sizes',
|
|
||||||
'--release',
|
|
||||||
'--no-pub',
|
|
||||||
'--target-platform',
|
|
||||||
];
|
|
||||||
switch (deviceOperatingSystem) {
|
|
||||||
case DeviceOperatingSystem.ios:
|
|
||||||
options.add('ios');
|
|
||||||
break;
|
|
||||||
case DeviceOperatingSystem.android:
|
|
||||||
options.add('android-arm');
|
|
||||||
break;
|
|
||||||
case DeviceOperatingSystem.fuchsia:
|
|
||||||
throw Exception('Unsupported option for Fuchsia devices');
|
|
||||||
}
|
|
||||||
final String compileLog = await evalFlutter('build', options: options);
|
|
||||||
watch.stop();
|
|
||||||
|
|
||||||
final RegExp metricExpression = RegExp(r'([a-zA-Z]+)\(CodeSize\)\: (\d+)');
|
|
||||||
final Map<String, dynamic> metrics = <String, dynamic>{};
|
|
||||||
for (final Match m in metricExpression.allMatches(compileLog)) {
|
|
||||||
metrics[_sdkNameToMetricName(m.group(1))] = int.parse(m.group(2));
|
|
||||||
}
|
|
||||||
if (metrics.length != _kSdkNameToMetricNameMapping.length) {
|
|
||||||
throw 'Expected metrics: ${_kSdkNameToMetricNameMapping.keys}, but got: ${metrics.keys}.';
|
|
||||||
}
|
|
||||||
metrics['aot_snapshot_compile_millis'] = watch.elapsedMilliseconds;
|
|
||||||
|
|
||||||
return metrics;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> _compileApp({ bool reportPackageContentSizes = false }) async {
|
static Future<Map<String, dynamic>> _compileApp({ bool reportPackageContentSizes = false }) async {
|
||||||
await flutter('clean');
|
await flutter('clean');
|
||||||
final Stopwatch watch = Stopwatch();
|
final Stopwatch watch = Stopwatch();
|
||||||
@ -485,22 +447,6 @@ class CompileTest {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Map<String, String> _kSdkNameToMetricNameMapping = <String, String> {
|
|
||||||
'VMIsolate': 'aot_snapshot_size_vmisolate',
|
|
||||||
'Isolate': 'aot_snapshot_size_isolate',
|
|
||||||
'ReadOnlyData': 'aot_snapshot_size_rodata',
|
|
||||||
'Instructions': 'aot_snapshot_size_instructions',
|
|
||||||
'Total': 'aot_snapshot_size_total',
|
|
||||||
};
|
|
||||||
|
|
||||||
static String _sdkNameToMetricName(String sdkName) {
|
|
||||||
|
|
||||||
if (!_kSdkNameToMetricNameMapping.containsKey(sdkName))
|
|
||||||
throw 'Unrecognized SDK snapshot metric name: $sdkName';
|
|
||||||
|
|
||||||
return _kSdkNameToMetricNameMapping[sdkName];
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> getSizesFromIosApp(String appPath) async {
|
static Future<Map<String, dynamic>> getSizesFromIosApp(String appPath) async {
|
||||||
// Thin the binary to only contain one architecture.
|
// Thin the binary to only contain one architecture.
|
||||||
final String xcodeBackend = path.join(flutterDirectory.path, 'packages', 'flutter_tools', 'bin', 'xcode_backend.sh');
|
final String xcodeBackend = path.join(flutterDirectory.path, 'packages', 'flutter_tools', 'bin', 'xcode_backend.sh');
|
||||||
@ -519,7 +465,6 @@ class CompileTest {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> getSizesFromApk(String apkPath) async {
|
static Future<Map<String, dynamic>> getSizesFromApk(String apkPath) async {
|
||||||
final String output = await eval('unzip', <String>['-v', apkPath]);
|
final String output = await eval('unzip', <String>['-v', apkPath]);
|
||||||
final List<String> lines = output.split('\n');
|
final List<String> lines = output.split('\n');
|
||||||
|
Loading…
Reference in New Issue
Block a user