Skip to content

Commit 449fb19

Browse files
Web Benchmarks Part 2: Benchmark Targeting & Fail-Fast Filtering (flutter#194400)
Adds benchmark targeting, fail-fast filtering, and incremental build support (`--no-clean`) to `runWebBenchmark` in `dev/devicelab/lib/tasks/web_benchmarks.dart`: - Retains the `WebBenchmarkOptions` record typedef and adds optional `targetBenchmarks`, `filterPattern`, and `clean` named parameters to `runWebBenchmark` with `BENCHMARK_TARGETS`, `BENCHMARK_FILTER`, and `BENCHMARK_CLEAN` environment variable fallbacks. - Adds `runWebBenchmarkFromArgs` so the `dev/devicelab/bin/tasks/web_benchmarks_*.dart` task entrypoints accept `--benchmark` (`-b`), `--filter` (`-f`), and `--[no-]clean` CLI flags. - Extracts `BenchmarkFilter` and `processBenchmarkProfiles` so unrecognized benchmark names (typos), zero-match regexes, or empty profile collections fail fast instead of returning a false-positive `TaskResult.success({})`. - Adds hermetic unit tests in `dev/devicelab/test/tasks/web_benchmarks_test.dart`. Part of flutter#191316 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent a3d71d8 commit 449fb19

7 files changed

Lines changed: 614 additions & 56 deletions

‎dev/devicelab/bin/tasks/web_benchmarks_canvaskit.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
88
const String buildMode = String.fromEnvironment('buildMode', defaultValue: 'profile');
99

1010
/// Runs all Web benchmarks using the CanvasKit rendering backend.
11-
Future<void> main() async {
11+
Future<void> main(List<String> args) async {
1212
await task(() async {
13-
return runWebBenchmark((
13+
return runWebBenchmarkFromArgs((
1414
useWasm: false,
1515
forceSingleThreadedSkwasm: false,
1616
useDdc: false,
1717
withHotReload: false,
1818
buildMode: buildMode,
19-
));
19+
), args);
2020
});
2121
}

‎dev/devicelab/bin/tasks/web_benchmarks_ddc.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import 'package:flutter_devicelab/framework/framework.dart';
66
import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
77

88
/// Runs all Web benchmarks using DDC.
9-
Future<void> main() async {
9+
Future<void> main(List<String> args) async {
1010
await task(() async {
11-
return runWebBenchmark((
11+
return runWebBenchmarkFromArgs((
1212
useWasm: false,
1313
forceSingleThreadedSkwasm: false,
1414
useDdc: true,
1515
withHotReload: true,
1616
buildMode: 'debug',
17-
));
17+
), args);
1818
});
1919
}

‎dev/devicelab/bin/tasks/web_benchmarks_ddc_hot_reload.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import 'package:flutter_devicelab/framework/framework.dart';
66
import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
77

88
/// Runs all Web benchmarks using DDC.
9-
Future<void> main() async {
9+
Future<void> main(List<String> args) async {
1010
await task(() async {
11-
return runWebBenchmark((
11+
return runWebBenchmarkFromArgs((
1212
useWasm: false,
1313
forceSingleThreadedSkwasm: false,
1414
useDdc: true,
1515
withHotReload: true,
1616
buildMode: 'debug',
17-
));
17+
), args);
1818
});
1919
}

‎dev/devicelab/bin/tasks/web_benchmarks_skwasm.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
88
const String buildMode = String.fromEnvironment('buildMode', defaultValue: 'profile');
99

1010
/// Runs all Web benchmarks using the Skwasm rendering backend.
11-
Future<void> main() async {
11+
Future<void> main(List<String> args) async {
1212
await task(() async {
13-
return runWebBenchmark((
13+
return runWebBenchmarkFromArgs((
1414
useWasm: true,
1515
forceSingleThreadedSkwasm: false,
1616
useDdc: false,
1717
withHotReload: false,
1818
buildMode: buildMode,
19-
));
19+
), args);
2020
});
2121
}

‎dev/devicelab/bin/tasks/web_benchmarks_skwasm_st.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
88
const String buildMode = String.fromEnvironment('buildMode', defaultValue: 'profile');
99

1010
/// Runs all Web benchmarks using the Skwasm rendering backend.
11-
Future<void> main() async {
11+
Future<void> main(List<String> args) async {
1212
await task(() async {
13-
return runWebBenchmark((
13+
return runWebBenchmarkFromArgs((
1414
useWasm: true,
1515
forceSingleThreadedSkwasm: true,
1616
useDdc: false,
1717
withHotReload: false,
1818
buildMode: buildMode,
19-
));
19+
), args);
2020
});
2121
}

0 commit comments

Comments
 (0)