Skip to content

Reset thresholds for performance benchmarks #9257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flutter-candidate.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a534b2138030409fb79079540d772602dcb7e7df
fac358d6fe65b1dfb9c8b8f2cd8d948f6ae91cf1
47 changes: 16 additions & 31 deletions packages/devtools_app/benchmark/devtools_benchmarks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void _verifyScoresAgainstThresholds(
}) {
final identifier = '${devToolsBenchmark.id}.${useWasm ? 'wasm' : 'js'}';
stdout.writeln('Verifying $identifier scores against expected thresholds.');
final benchmarkThresholds = _benchmarkThresholds(useWasm);
final benchmarkThresholds = _benchmarkThresholds(/*useWasm*/);
expect(
benchmarkThresholds.containsKey(devToolsBenchmark),
isTrue,
Expand Down Expand Up @@ -171,71 +171,56 @@ void _verifyScoresAgainstThresholds(
}

const _frameTimeFor60FPSInMicros = 16666.6;
const _frameTimeFor30FPSInMicros = 33333.3;
// const _frameTimeFor30FPSInMicros = 33333.3;

/// Creates the expected [DevToolsBenchmark]s for the specified compiler.
///
/// Note that some of the wasm benchmarks use a 30fps frame budget instead of
/// the 60fps frame budget due to https://issues.chromium.org/issues/396208308.
Map<DevToolsBenchmark, Map<String, num>> _benchmarkThresholds(bool isWasm) => {
// Note that some of these benchmarks exceed the 60fps frame budget,
// especially the p90 benchmarks.
//
// See https://github.com/flutter/devtools/pull/8892 which exposes this.
Map<DevToolsBenchmark, Map<String, num>> _benchmarkThresholds(/*bool isWasm*/) => {
DevToolsBenchmark.navigateThroughOfflineScreens: {
..._valuesForMetric(
BenchmarkMetric.flutterFrameTotalTime,
avg: _frameTimeFor60FPSInMicros * 2,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros * 6,
p90: _frameTimeFor60FPSInMicros,
),
..._valuesForMetric(
BenchmarkMetric.flutterFrameBuildTime,
avg: _frameTimeFor60FPSInMicros * 2,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
),
..._valuesForMetric(
BenchmarkMetric.flutterFrameRasterTime,
avg: _frameTimeFor60FPSInMicros * 2,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
),
},
// Note that some of these benchmarks exceed the 60fps frame budget,
// especially the p90 benchmarks.
//
// See https://github.com/flutter/devtools/pull/8892 which exposes this.
DevToolsBenchmark.offlineCpuProfilerScreen: {
..._valuesForMetric(
BenchmarkMetric.flutterFrameTotalTime,
avg:
(isWasm ? _frameTimeFor30FPSInMicros : _frameTimeFor60FPSInMicros) *
2,
p50: isWasm ? _frameTimeFor30FPSInMicros * 2 : _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros * 6,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
),
..._valuesForMetric(
BenchmarkMetric.flutterFrameBuildTime,
avg: _frameTimeFor60FPSInMicros * 2,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: isWasm ? _frameTimeFor30FPSInMicros : _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
),
..._valuesForMetric(
BenchmarkMetric.flutterFrameRasterTime,
avg:
(isWasm ? _frameTimeFor30FPSInMicros : _frameTimeFor60FPSInMicros) *
2,
p50: isWasm ? _frameTimeFor30FPSInMicros * 2 : _frameTimeFor60FPSInMicros,
p90: isWasm ? _frameTimeFor30FPSInMicros * 3 : _frameTimeFor60FPSInMicros,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
),
},
DevToolsBenchmark.offlinePerformanceScreen: {
..._valuesForMetric(
BenchmarkMetric.flutterFrameTotalTime,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor30FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
),
..._valuesForMetric(
BenchmarkMetric.flutterFrameBuildTime,
Expand Down
Loading