Skip to content
Open
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
17 changes: 13 additions & 4 deletions packages/devtools_app/benchmark/devtools_benchmarks_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ void _verifyScoresAgainstThresholds(
final scoreName = _generateScoreName(metric, computation);
final score = scoresAsMap[scoreName]!.value;
final threshold = expectedThresholds[scoreName]!;
stdout.writeln(' $scoreName: $score μs (threshold: $threshold μs)');
if (score > threshold) {
_exceededThresholds.writeln(
exceededThresholdLine(
Expand All @@ -199,9 +200,17 @@ void _verifyScoresAgainstThresholds(
}

const _frameTimeFor60FPSInMicros = 16666.6;
// const _frameTimeFor30FPSInMicros = 33333.3;
// 1.5x the 60 FPS frame budget (~25 ms / 40 FPS) for total_time.p90 on the
// heavier offline screens.
const _relaxedP90FrameTimeInMicros = _frameTimeFor60FPSInMicros * 1.5;

/// Creates the expected [DevToolsBenchmark]s for the specified compiler.
/// Creates the expected [DevToolsBenchmark] thresholds.
///
/// Average, p50, and build/raster p90 frame times are held to the 60 FPS budget
/// ([_frameTimeFor60FPSInMicros]). Total frame time p90 on the heavier offline
/// screens uses [_relaxedP90FrameTimeInMicros] to absorb occasional tail-latency
/// jitter on CI runners without masking average/median or build/raster
/// regressions.
Map<DevToolsBenchmark, Map<String, num>> _benchmarkThresholds(
/*bool isWasm*/
) => {
Expand Down Expand Up @@ -230,7 +239,7 @@ Map<DevToolsBenchmark, Map<String, num>> _benchmarkThresholds(
BenchmarkMetric.flutterFrameTotalTime,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
p90: _relaxedP90FrameTimeInMicros,
),
..._valuesForMetric(
BenchmarkMetric.flutterFrameBuildTime,
Expand All @@ -250,7 +259,7 @@ Map<DevToolsBenchmark, Map<String, num>> _benchmarkThresholds(
BenchmarkMetric.flutterFrameTotalTime,
avg: _frameTimeFor60FPSInMicros,
p50: _frameTimeFor60FPSInMicros,
p90: _frameTimeFor60FPSInMicros,
p90: _relaxedP90FrameTimeInMicros,
),
..._valuesForMetric(
BenchmarkMetric.flutterFrameBuildTime,
Expand Down
Loading