diff --git a/.ci.yaml b/.ci.yaml index 2ddc8a1cca..78b9751b53 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -65,7 +65,7 @@ platform_properties: device_type: none dependencies: >- [ - {"dependency": "chrome_and_driver", "version": "version:114.0"} + {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"} ] windows_arm64: properties: @@ -327,7 +327,7 @@ targets: {"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"}, {"dependency": "cmake", "version": "build_id:8787856497187628321"}, {"dependency": "ninja", "version": "version:1.9.0"}, - {"dependency": "chrome_and_driver", "version": "version:114.0"} + {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"} ] channel: master env_variables: >- @@ -350,7 +350,7 @@ targets: {"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"}, {"dependency": "cmake", "version": "build_id:8787856497187628321"}, {"dependency": "ninja", "version": "version:1.9.0"}, - {"dependency": "chrome_and_driver", "version": "version:114.0"} + {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"} ] channel: stable env_variables: >- @@ -935,7 +935,7 @@ targets: # Install Chrome as a default handler for schemes for url_launcher. dependencies: >- [ - {"dependency": "chrome_and_driver", "version": "version:114.0"} + {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"} ] env_variables: >- { @@ -953,7 +953,7 @@ targets: # Install Chrome as a default handler for schemes for url_launcher. dependencies: >- [ - {"dependency": "chrome_and_driver", "version": "version:114.0"} + {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"} ] env_variables: >- { diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index cd1b8af689..0a5ec61db8 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,6 +1,10 @@ -## NEXT +## 2.0.0 * Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. +* Adds support for running benchmarks with the wasm compilation target. +* **Breaking change** `CompilationOptions` unnamed constructor has been replaced with +two named constructors, `CompilationOptions.js` and `CompilationOptions.wasm` for +JavaScript and WebAssembly compilation respectively. ## 1.2.2 diff --git a/packages/web_benchmarks/lib/server.dart b/packages/web_benchmarks/lib/server.dart index 1742ac507c..514b111d95 100644 --- a/packages/web_benchmarks/lib/server.dart +++ b/packages/web_benchmarks/lib/server.dart @@ -50,7 +50,7 @@ Future serveWebBenchmark({ bool headless = true, bool treeShakeIcons = true, String initialPage = defaultInitialPage, - CompilationOptions compilationOptions = const CompilationOptions(), + CompilationOptions compilationOptions = const CompilationOptions.js(), }) async { // Reduce logging level. Otherwise, package:webkit_inspection_protocol is way too spammy. Logger.root.level = Level.INFO; diff --git a/packages/web_benchmarks/lib/src/compilation_options.dart b/packages/web_benchmarks/lib/src/compilation_options.dart index 3a994703c6..30a349c252 100644 --- a/packages/web_benchmarks/lib/src/compilation_options.dart +++ b/packages/web_benchmarks/lib/src/compilation_options.dart @@ -7,11 +7,15 @@ /// This object holds metadata that is used to determine how the benchmark app /// should be built. class CompilationOptions { - /// Creates a [CompilationOptions] object. - const CompilationOptions({ + /// Creates a [CompilationOptions] object that compiles to JavaScript. + const CompilationOptions.js({ this.renderer = WebRenderer.canvaskit, - this.useWasm = false, - }); + }) : useWasm = false; + + /// Creates a [CompilationOptions] object that compiles to WebAssembly. + const CompilationOptions.wasm() + : useWasm = true, + renderer = WebRenderer.skwasm; /// The renderer to use for the build. final WebRenderer renderer; diff --git a/packages/web_benchmarks/lib/src/runner.dart b/packages/web_benchmarks/lib/src/runner.dart index 8eeaeb0617..87e924194e 100644 --- a/packages/web_benchmarks/lib/src/runner.dart +++ b/packages/web_benchmarks/lib/src/runner.dart @@ -55,7 +55,7 @@ class BenchmarkServer { required this.chromeDebugPort, required this.headless, required this.treeShakeIcons, - this.compilationOptions = const CompilationOptions(), + this.compilationOptions = const CompilationOptions.js(), this.initialPage = defaultInitialPage, }); @@ -119,10 +119,9 @@ class BenchmarkServer { 'web', if (compilationOptions.useWasm) ...[ '--wasm', - '--wasm-opt=debug', - '--omit-type-checks', - ], - '--web-renderer=${compilationOptions.renderer.name}', + '--no-strip-wasm', + ] else + '--web-renderer=${compilationOptions.renderer.name}', '--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true', if (!treeShakeIcons) '--no-tree-shake-icons', '--profile', diff --git a/packages/web_benchmarks/pubspec.yaml b/packages/web_benchmarks/pubspec.yaml index cbf15b25c1..5b341d3f35 100644 --- a/packages/web_benchmarks/pubspec.yaml +++ b/packages/web_benchmarks/pubspec.yaml @@ -2,7 +2,7 @@ name: web_benchmarks description: A benchmark harness for performance-testing Flutter apps in Chrome. repository: https://github.com/flutter/packages/tree/main/packages/web_benchmarks issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+web_benchmarks%22 -version: 1.2.2 +version: 2.0.0 environment: sdk: ^3.3.0 diff --git a/packages/web_benchmarks/testing/test_app/web/index.html b/packages/web_benchmarks/testing/test_app/web/index.html index 0489be3063..5b2c184c9a 100644 --- a/packages/web_benchmarks/testing/test_app/web/index.html +++ b/packages/web_benchmarks/testing/test_app/web/index.html @@ -21,16 +21,6 @@ found in the LICENSE file. --> - - - + diff --git a/packages/web_benchmarks/testing/web_benchmarks_test.dart b/packages/web_benchmarks/testing/web_benchmarks_test.dart index 6c91d4bda4..547ddee4f7 100644 --- a/packages/web_benchmarks/testing/web_benchmarks_test.dart +++ b/packages/web_benchmarks/testing/web_benchmarks_test.dart @@ -32,10 +32,9 @@ Future main() async { await _runBenchmarks( benchmarkNames: ['simple'], entryPoint: 'lib/benchmarks/runner_simple.dart', - compilationOptions: const CompilationOptions(useWasm: true), + compilationOptions: const CompilationOptions.wasm(), ); }, - skip: true, // https://github.com/flutter/flutter/issues/142809 timeout: Timeout.none, ); } @@ -44,7 +43,7 @@ Future _runBenchmarks({ required List benchmarkNames, required String entryPoint, String initialPage = defaultInitialPage, - CompilationOptions compilationOptions = const CompilationOptions(), + CompilationOptions compilationOptions = const CompilationOptions.js(), }) async { final BenchmarkResults taskResult = await serveWebBenchmark( benchmarkAppDirectory: Directory('testing/test_app'),