remove frame policy benchmark. (#163245)
This benchmark is a benchmark of the integration test binding which IMO is not that important given that we continue to rely on flutter_driver for actual performance metrics.
This commit is contained in:
parent
ce659cda5e
commit
89311b7600
9
.ci.yaml
9
.ci.yaml
@ -2739,15 +2739,6 @@ targets:
|
||||
["devicelab", "android", "linux", "mokey"]
|
||||
task_name: flutter_view__start_up
|
||||
|
||||
- name: Linux_pixel_7pro frame_policy_delay_test_android
|
||||
recipe: devicelab/devicelab_drone
|
||||
presubmit: false
|
||||
timeout: 60
|
||||
properties:
|
||||
tags: >
|
||||
["devicelab", "android", "linux", "pixel", "7pro"]
|
||||
task_name: frame_policy_delay_test_android
|
||||
|
||||
# linux mokey benchmark
|
||||
- name: Linux_mokey fullscreen_textfield_perf
|
||||
recipe: devicelab/devicelab_drone
|
||||
|
@ -56,7 +56,6 @@
|
||||
/dev/devicelab/bin/tasks/flutter_gallery_v2_chrome_run_test.dart @yjbanov @flutter/web
|
||||
/dev/devicelab/bin/tasks/flutter_gallery_v2_web_compile_test.dart @yjbanov @flutter/web
|
||||
/dev/devicelab/bin/tasks/flutter_test_performance.dart @jtmcdole @flutter/engine
|
||||
/dev/devicelab/bin/tasks/frame_policy_delay_test_android.dart @jtmcdole @flutter/engine
|
||||
/dev/devicelab/bin/tasks/fullscreen_textfield_perf.dart @jtmcdole @flutter/engine
|
||||
/dev/devicelab/bin/tasks/fullscreen_textfield_perf__e2e_summary.dart @jtmcdole @flutter/engine
|
||||
/dev/devicelab/bin/tasks/gradient_consistent_perf__e2e_summary.dart @flar @flutter/engine
|
||||
|
@ -1,87 +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/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
import 'package:macrobenchmarks/src/simple_scroll.dart';
|
||||
|
||||
void main() {
|
||||
final IntegrationTestWidgetsFlutterBinding binding =
|
||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
testWidgets('Frame Counter and Input Delay for benchmarkLive', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(home: Scaffold(body: SimpleScroll())));
|
||||
await tester.pumpAndSettle();
|
||||
final Offset location = tester.getCenter(find.byType(ListView));
|
||||
int frameCount = 0;
|
||||
void frameCounter(Duration elapsed) {
|
||||
frameCount += 1;
|
||||
}
|
||||
|
||||
tester.binding.addPersistentFrameCallback(frameCounter);
|
||||
|
||||
const int timeInSecond = 1;
|
||||
const Duration totalTime = Duration(seconds: timeInSecond);
|
||||
const int moveEventNumber = timeInSecond * 120; // 120Hz
|
||||
const Offset movePerRun = Offset(0.0, -200.0 / moveEventNumber);
|
||||
final List<PointerEventRecord> records = <PointerEventRecord>[
|
||||
PointerEventRecord(Duration.zero, <PointerEvent>[
|
||||
PointerAddedEvent(position: location),
|
||||
PointerDownEvent(position: location, pointer: 1),
|
||||
]),
|
||||
...<PointerEventRecord>[
|
||||
for (int t = 0; t < moveEventNumber; t++)
|
||||
PointerEventRecord(totalTime * (t / moveEventNumber), <PointerEvent>[
|
||||
PointerMoveEvent(
|
||||
timeStamp: totalTime * (t / moveEventNumber),
|
||||
position: location + movePerRun * t.toDouble(),
|
||||
pointer: 1,
|
||||
delta: movePerRun,
|
||||
),
|
||||
]),
|
||||
],
|
||||
PointerEventRecord(totalTime, <PointerEvent>[
|
||||
PointerUpEvent(
|
||||
// Deviate a little from integer number of frames to reduce flakiness
|
||||
timeStamp: totalTime - const Duration(milliseconds: 1),
|
||||
position: location + movePerRun * moveEventNumber.toDouble(),
|
||||
pointer: 1,
|
||||
),
|
||||
]),
|
||||
];
|
||||
|
||||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.benchmarkLive;
|
||||
List<Duration> delays = await tester.handlePointerEventRecord(records);
|
||||
await tester.pumpAndSettle();
|
||||
binding.reportData = <String, dynamic>{'benchmarkLive': _summarizeResult(frameCount, delays)};
|
||||
await tester.idle();
|
||||
await tester.binding.delayed(const Duration(milliseconds: 250));
|
||||
|
||||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
|
||||
frameCount = 0;
|
||||
delays = await tester.handlePointerEventRecord(records);
|
||||
await tester.pumpAndSettle();
|
||||
binding.reportData!['fullyLive'] = _summarizeResult(frameCount, delays);
|
||||
await tester.idle();
|
||||
});
|
||||
}
|
||||
|
||||
Map<String, dynamic> _summarizeResult(final int frameCount, final List<Duration> delays) {
|
||||
assert(delays.length > 1);
|
||||
final List<int> delayedInMicro =
|
||||
delays.map<int>((Duration delay) => delay.inMicroseconds).toList();
|
||||
final List<int> delayedInMicroSorted = List<int>.from(delayedInMicro)..sort();
|
||||
final int index90th = (delayedInMicroSorted.length * 0.90).round();
|
||||
final int percentile90th = delayedInMicroSorted[index90th];
|
||||
final int sum = delayedInMicroSorted.reduce((int a, int b) => a + b);
|
||||
final double averageDelay = sum.toDouble() / delayedInMicroSorted.length;
|
||||
return <String, dynamic>{
|
||||
'frame_count': frameCount,
|
||||
'average_delay_millis': averageDelay / 1E3,
|
||||
'90th_percentile_delay_millis': percentile90th / 1E3,
|
||||
if (kDebugMode) 'delaysInMicro': delayedInMicro,
|
||||
};
|
||||
}
|
@ -1,28 +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 'dart:io';
|
||||
|
||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||
|
||||
Future<void> main() => driver.integrationDriver(
|
||||
responseDataCallback: (Map<String, dynamic>? data) async {
|
||||
final Map<String, dynamic> benchmarkLiveResult = data?['benchmarkLive'] as Map<String, dynamic>;
|
||||
final Map<String, dynamic> fullyLiveResult = data?['fullyLive'] as Map<String, dynamic>;
|
||||
|
||||
if (benchmarkLiveResult['frame_count'] as int < 10 ||
|
||||
fullyLiveResult['frame_count'] as int < 10) {
|
||||
print(
|
||||
'Failure Details:\nNot Enough frames collected: '
|
||||
'benchmarkLive ${benchmarkLiveResult['frameCount']}, '
|
||||
'${fullyLiveResult['frameCount']}.',
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
await driver.writeResponseData(<String, dynamic>{
|
||||
'benchmarkLive': benchmarkLiveResult,
|
||||
'fullyLive': fullyLiveResult,
|
||||
}, testOutputFilename: 'frame_policy_event_delay');
|
||||
},
|
||||
);
|
@ -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<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFramePolicyIntegrationTest());
|
||||
}
|
@ -534,51 +534,6 @@ TaskFunction createsScrollSmoothnessPerfTest() {
|
||||
};
|
||||
}
|
||||
|
||||
TaskFunction createFramePolicyIntegrationTest() {
|
||||
final String testDirectory = '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks';
|
||||
const String testTarget = 'test/frame_policy.dart';
|
||||
return () {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
final String deviceId = device.deviceId;
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
await flutter(
|
||||
'drive',
|
||||
options: <String>[
|
||||
'--no-android-gradle-daemon',
|
||||
'-v',
|
||||
'--verbose-system-logs',
|
||||
'--profile',
|
||||
'-t',
|
||||
testTarget,
|
||||
'-d',
|
||||
deviceId,
|
||||
],
|
||||
);
|
||||
final Map<String, dynamic> data =
|
||||
json.decode(
|
||||
file(
|
||||
'${testOutputDirectory(testDirectory)}/frame_policy_event_delay.json',
|
||||
).readAsStringSync(),
|
||||
)
|
||||
as Map<String, dynamic>;
|
||||
final Map<String, dynamic> fullLiveData = data['fullyLive'] as Map<String, dynamic>;
|
||||
final Map<String, dynamic> benchmarkLiveData = data['benchmarkLive'] as Map<String, dynamic>;
|
||||
final Map<String, dynamic> dataFormatted = <String, dynamic>{
|
||||
'average_delay_fullyLive_millis': fullLiveData['average_delay_millis'],
|
||||
'average_delay_benchmarkLive_millis': benchmarkLiveData['average_delay_millis'],
|
||||
'90th_percentile_delay_fullyLive_millis': fullLiveData['90th_percentile_delay_millis'],
|
||||
'90th_percentile_delay_benchmarkLive_millis':
|
||||
benchmarkLiveData['90th_percentile_delay_millis'],
|
||||
};
|
||||
|
||||
return TaskResult.success(dataFormatted, benchmarkScoreKeys: dataFormatted.keys.toList());
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
TaskFunction createOpacityPeepholeOneRectPerfE2ETest() {
|
||||
return PerfTest.e2e(
|
||||
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
|
||||
|
Loading…
x
Reference in New Issue
Block a user