diff --git a/.ci.yaml b/.ci.yaml index 83183f3355..1fa2ef0546 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -1541,23 +1541,6 @@ targets: ["devicelab","hostonly", "linux"] task_name: web_benchmarks_canvaskit - - name: Linux web_benchmarks_html - recipe: devicelab/devicelab_drone - timeout: 60 - properties: - dependencies: >- - [ - {"dependency": "android_sdk", "version": "version:35v1"}, - {"dependency": "chrome_and_driver", "version": "version:125.0.6422.141"} - ] - tags: > - ["devicelab"] - task_name: web_benchmarks_html - runIf: - - dev/** - - bin/** - - .ci.yaml - - name: Linux web_benchmarks_skwasm recipe: devicelab/devicelab_drone presubmit: false diff --git a/TESTOWNERS b/TESTOWNERS index 57a180a3e2..44da941b0f 100644 --- a/TESTOWNERS +++ b/TESTOWNERS @@ -290,7 +290,6 @@ /dev/devicelab/bin/tasks/run_release_test_windows.dart @loic-sharma @flutter/tool /dev/devicelab/bin/tasks/technical_debt__cost.dart @Piinks @flutter/framework /dev/devicelab/bin/tasks/web_benchmarks_canvaskit.dart @yjbanov @flutter/web -/dev/devicelab/bin/tasks/web_benchmarks_html.dart @yjbanov @flutter/web /dev/devicelab/bin/tasks/web_benchmarks_skwasm.dart @eyebrowsoffire @flutter/web /dev/devicelab/bin/tasks/web_benchmarks_skwasm_st.dart @eyebrowsoffire @flutter/web /dev/devicelab/bin/tasks/windows_home_scroll_perf__timeline_summary.dart @jonahwilliams @flutter/engine diff --git a/dev/benchmarks/macrobenchmarks/README.md b/dev/benchmarks/macrobenchmarks/README.md index 2f2dce6ce6..b1c2e92b02 100644 --- a/dev/benchmarks/macrobenchmarks/README.md +++ b/dev/benchmarks/macrobenchmarks/README.md @@ -111,7 +111,7 @@ in `lib/web_benchmarks.dart`. ### How to run a web benchmark Web benchmarks can be run using `flutter run` in debug, profile, and release -modes, using either the HTML or the CanvasKit rendering backend. Note, however, +modes, using either the CanvasKit or the Skwasm rendering backend. Note, however, that running in debug mode will result in worse numbers. Profile mode is useful for profiling in Chrome DevTools because the numbers are close to release mode and the profile contains unobfuscated names. @@ -121,9 +121,6 @@ Example: ```sh cd dev/benchmarks/macrobenchmarks -# Runs in profile mode using the HTML renderer -flutter run --web-renderer=html --profile -d web-server lib/web_benchmarks.dart - # Runs in profile mode using the CanvasKit renderer flutter run --web-renderer=canvaskit --profile -d web-server lib/web_benchmarks.dart ``` @@ -133,9 +130,6 @@ You can also run all benchmarks exactly as the devicelab runs them: ```sh cd dev/devicelab -# Runs using the HTML renderer -../../bin/cache/dart-sdk/bin/dart bin/run.dart -t bin/tasks/web_benchmarks_html.dart - # Runs using the CanvasKit renderer ../../bin/cache/dart-sdk/bin/dart bin/run.dart -t bin/tasks/web_benchmarks_canvaskit.dart ``` diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_child_layers.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_child_layers.dart index 4a82f43f4c..24b9d6592d 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_child_layers.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_child_layers.dart @@ -9,8 +9,7 @@ import 'recorder.dart'; /// Repeatedly paints a grid of rectangles where each rectangle is drawn in its /// own [Picture]. /// -/// Measures the performance of updating many layers. For example, the HTML -/// rendering backend attempts to reuse the DOM nodes created for engine layers. +/// Measures the performance of updating many layers. /// /// See also `bench_draw_rect.dart`, which draws nearly identical UI but puts all /// rectangles into the same picture. diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_image_decoding.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_image_decoding.dart index 1bc691ea85..32047dd5e2 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_image_decoding.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_image_decoding.dart @@ -18,10 +18,6 @@ import 'recorder.dart'; // WASM codecs execute on the main thread and block the UI, leading to jank, // but the browser's WebCodecs API is asynchronous running on a separate thread // and does not jank. However, the benchmark result may be the same. -// -// This benchmark does not support the HTML renderer because the HTML renderer -// cannot decode image frames (it always returns 1 dummy frame, even for -// animated images). class BenchImageDecoding extends RawRecorder { BenchImageDecoding() : super( name: benchmarkName, diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart index 6788ec8b71..bebbbf54be 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart @@ -45,27 +45,13 @@ class ParagraphGenerator { } } -/// Which mode to run [BenchBuildColorsGrid] in. -enum _TestMode { - /// Uses the HTML rendering backend with the canvas 2D text layout. - useCanvasTextLayout, - - /// Uses CanvasKit for everything. - useCanvasKit, -} - /// Repeatedly lays out a paragraph. /// /// Creates a different paragraph each time in order to avoid hitting the cache. class BenchTextLayout extends RawRecorder { - BenchTextLayout.canvas() - : super(name: canvasBenchmarkName); + BenchTextLayout() : super(name: benchmarkName); - BenchTextLayout.canvasKit() - : super(name: canvasKitBenchmarkName); - - static const String canvasBenchmarkName = 'text_canvas_layout'; - static const String canvasKitBenchmarkName = 'text_canvaskit_layout'; + static const String benchmarkName = 'text_canvaskit_layout'; final ParagraphGenerator generator = ParagraphGenerator(); @@ -143,14 +129,9 @@ class BenchTextLayout extends RawRecorder { /// use the same paragraph instance because the layout method will shortcircuit /// in that case. class BenchTextCachedLayout extends RawRecorder { - BenchTextCachedLayout.canvas() - : super(name: canvasBenchmarkName); + BenchTextCachedLayout() : super(name: benchmarkName); - BenchTextCachedLayout.canvasKit() - : super(name: canvasKitBenchmarkName); - - static const String canvasBenchmarkName = 'text_canvas_cached_layout'; - static const String canvasKitBenchmarkName = 'text_canvas_kit_cached_layout'; + static const String benchmarkName = 'text_canvas_kit_cached_layout'; @override void body(Profile profile) { @@ -179,11 +160,7 @@ int _counter = 0; /// The benchmark constructs a tabbed view, where each tab displays a list of /// colors. Each color's description is made of several [Text] nodes. class BenchBuildColorsGrid extends WidgetBuildRecorder { - BenchBuildColorsGrid.canvas() - : _mode = _TestMode.useCanvasTextLayout, super(name: canvasBenchmarkName); - - BenchBuildColorsGrid.canvasKit() - : _mode = _TestMode.useCanvasKit, super(name: canvasKitBenchmarkName); + BenchBuildColorsGrid() : super(name: benchmarkName); /// Disables tracing for this benchmark. /// @@ -193,47 +170,7 @@ class BenchBuildColorsGrid extends WidgetBuildRecorder { @override bool get isTracingEnabled => false; - static const String canvasBenchmarkName = 'text_canvas_color_grid'; - static const String canvasKitBenchmarkName = 'text_canvas_kit_color_grid'; - - /// Whether to use the new canvas-based text measurement implementation. - final _TestMode _mode; - - num _textLayoutMicros = 0; - - @override - Future setUpAll() async { - super.setUpAll(); - registerEngineBenchmarkValueListener('text_layout', (num value) { - _textLayoutMicros += value; - }); - } - - @override - Future tearDownAll() async { - stopListeningToEngineBenchmarkValues('text_layout'); - } - - @override - void frameWillDraw() { - super.frameWillDraw(); - _textLayoutMicros = 0; - } - - @override - void frameDidDraw() { - // We need to do this before calling [super.frameDidDraw] because the latter - // updates the value of [showWidget] in preparation for the next frame. - // TODO(yjbanov): https://github.com/flutter/flutter/issues/53877 - if (showWidget && _mode != _TestMode.useCanvasKit) { - profile!.addDataPoint( - 'text_layout', - Duration(microseconds: _textLayoutMicros.toInt()), - reported: true, - ); - } - super.frameDidDraw(); - } + static const String benchmarkName = 'text_canvas_kit_color_grid'; @override Widget createWidget() { diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart index e67fa24668..cecec99201 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart @@ -36,8 +36,8 @@ const int kDefaultTotalSampleCount = _kDefaultWarmUpSampleCount + _kDefaultMeasu /// A benchmark metric that includes frame-related computations prior to /// submitting layer and picture operations to the underlying renderer, such as -/// HTML and CanvasKit. During this phase we compute transforms, clips, and -/// other information needed for rendering. +/// CanvasKit. During this phase we compute transforms, clips, and other +/// information needed for rendering. const String kProfilePrerollFrame = 'preroll_frame'; /// A benchmark metric that includes submitting layer and picture information diff --git a/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart b/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart index 28ecf09855..d396ba63db 100644 --- a/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart +++ b/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart @@ -36,7 +36,6 @@ import 'src/web/recorder.dart'; typedef RecorderFactory = Recorder Function(); -const bool isCanvasKit = bool.fromEnvironment('FLUTTER_WEB_USE_SKIA'); const bool isSkwasm = bool.fromEnvironment('FLUTTER_WEB_USE_SKWASM'); /// List of all benchmarks that run in the devicelab. @@ -80,24 +79,11 @@ final Map benchmarks = { BenchMaterial3Semantics.benchmarkName: () => BenchMaterial3Semantics(), BenchMaterial3ScrollSemantics.benchmarkName: () => BenchMaterial3ScrollSemantics(), - // Skia-only benchmarks - if (isCanvasKit || isSkwasm) ...{ - BenchTextLayout.canvasKitBenchmarkName: () => BenchTextLayout.canvasKit(), - BenchBuildColorsGrid.canvasKitBenchmarkName: () => BenchBuildColorsGrid.canvasKit(), - BenchTextCachedLayout.canvasKitBenchmarkName: () => BenchTextCachedLayout.canvasKit(), + BenchTextLayout.benchmarkName: () => BenchTextLayout(), + BenchBuildColorsGrid.benchmarkName: () => BenchBuildColorsGrid(), + BenchTextCachedLayout.benchmarkName: () => BenchTextCachedLayout(), - // The HTML renderer does not decode frame-by-frame. It just drops an - // element and lets it animate automatically with no feedback to the - // framework. So this benchmark only makes sense in CanvasKit. - BenchImageDecoding.benchmarkName: () => BenchImageDecoding(), - }, - - // HTML-only benchmarks - if (!isCanvasKit && !isSkwasm) ...{ - BenchTextLayout.canvasBenchmarkName: () => BenchTextLayout.canvas(), - BenchTextCachedLayout.canvasBenchmarkName: () => BenchTextCachedLayout.canvas(), - BenchBuildColorsGrid.canvasBenchmarkName: () => BenchBuildColorsGrid.canvas(), - }, + BenchImageDecoding.benchmarkName: () => BenchImageDecoding(), }; final LocalBenchmarkServerClient _client = LocalBenchmarkServerClient(); diff --git a/dev/devicelab/bin/tasks/web_benchmarks_canvaskit.dart b/dev/devicelab/bin/tasks/web_benchmarks_canvaskit.dart index e420fc3389..8c0c319ffa 100644 --- a/dev/devicelab/bin/tasks/web_benchmarks_canvaskit.dart +++ b/dev/devicelab/bin/tasks/web_benchmarks_canvaskit.dart @@ -9,7 +9,6 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart'; Future main() async { await task(() async { return runWebBenchmark(( - webRenderer: 'canvaskit', useWasm: false, forceSingleThreadedSkwasm: false, )); diff --git a/dev/devicelab/bin/tasks/web_benchmarks_html.dart b/dev/devicelab/bin/tasks/web_benchmarks_html.dart deleted file mode 100644 index a5a7e39db3..0000000000 --- a/dev/devicelab/bin/tasks/web_benchmarks_html.dart +++ /dev/null @@ -1,17 +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/framework.dart'; -import 'package:flutter_devicelab/tasks/web_benchmarks.dart'; - -/// Runs all Web benchmarks using the HTML rendering backend. -Future main() async { - await task(() async { - return runWebBenchmark(( - webRenderer: 'html', - useWasm: false, - forceSingleThreadedSkwasm: false, - )); - }); -} diff --git a/dev/devicelab/bin/tasks/web_benchmarks_skwasm.dart b/dev/devicelab/bin/tasks/web_benchmarks_skwasm.dart index f729c6d48a..cf26d6db48 100644 --- a/dev/devicelab/bin/tasks/web_benchmarks_skwasm.dart +++ b/dev/devicelab/bin/tasks/web_benchmarks_skwasm.dart @@ -9,7 +9,6 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart'; Future main() async { await task(() async { return runWebBenchmark(( - webRenderer: 'skwasm', useWasm: true, forceSingleThreadedSkwasm: false, )); diff --git a/dev/devicelab/bin/tasks/web_benchmarks_skwasm_st.dart b/dev/devicelab/bin/tasks/web_benchmarks_skwasm_st.dart index 71698683ed..a84ab93eb5 100644 --- a/dev/devicelab/bin/tasks/web_benchmarks_skwasm_st.dart +++ b/dev/devicelab/bin/tasks/web_benchmarks_skwasm_st.dart @@ -9,7 +9,6 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart'; Future main() async { await task(() async { return runWebBenchmark(( - webRenderer: 'skwasm', useWasm: true, forceSingleThreadedSkwasm: true, )); diff --git a/dev/devicelab/lib/tasks/web_benchmarks.dart b/dev/devicelab/lib/tasks/web_benchmarks.dart index 2368a38720..cf5cb8d54c 100644 --- a/dev/devicelab/lib/tasks/web_benchmarks.dart +++ b/dev/devicelab/lib/tasks/web_benchmarks.dart @@ -21,7 +21,6 @@ const int benchmarkServerPort = 9999; const int chromeDebugPort = 10000; typedef WebBenchmarkOptions = ({ - String webRenderer, bool useWasm, bool forceSingleThreadedSkwasm, }); @@ -41,7 +40,6 @@ Future runWebBenchmark(WebBenchmarkOptions benchmarkOptions) async { '--no-strip-wasm', ], '--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true', - if (!benchmarkOptions.useWasm) '--web-renderer=${benchmarkOptions.webRenderer}', '--profile', '--no-web-resources-cdn', '-t', @@ -175,10 +173,10 @@ Future runWebBenchmark(WebBenchmarkOptions benchmarkOptions) async { } final String webRendererName; - if (benchmarkOptions.useWasm && benchmarkOptions.forceSingleThreadedSkwasm) { - webRendererName = 'skwasm_st'; + if (benchmarkOptions.useWasm) { + webRendererName = benchmarkOptions.forceSingleThreadedSkwasm ? 'skwasm_st' : 'skwasm'; } else { - webRendererName = benchmarkOptions.webRenderer; + webRendererName = 'canvaskit'; } final String namespace = '$benchmarkName.$webRendererName'; final List scoreKeys = List.from(profile['scoreKeys'] as List);