flutter/dev/benchmarks/macrobenchmarks/lib/web_benchmarks_ddc.dart
MarkZ 2a3e27fdd9
Adding support for macrobenchmarking with "flutter run" (#167692)
Notable changes:
* Allows macrobenchmarks to run via `flutter run`.
* Splits macrobenchmarking between "orchestration logic" and "app
serving" (served on separate ports on the same machine to keep the
scheme consistent with the `flutter build` path).
* Adds an intercepted entrypoint for web benchmarks. We can't pass flags
to the app since it's not supported, so I've hard-coded the
orchestration server's port.
* Adding logic to connect to an existing Chrome debugger instance (vs
spawning one) for benchmarks.
2025-04-28 23:39:40 +00:00

19 lines
885 B
Dart

// 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 'web_benchmarks.dart';
/// An entrypoint used by DDC for running macrobenchmarks.
///
/// DDC runs macrobenchmarks via 'flutter run', which hosts files from its own
/// local server. As a result, the macrobenchmarking orchestration server needs
/// to be hosted on a separate port. We split the entrypoint here because we
/// can't pass command line args to Dart apps on Flutter Web.
///
// TODO(markzipan): Use `main` in `'web_benchmarks.dart` when Flutter Web supports the `--dart-entrypoint-args` flag.
Future<void> main() async {
// This is hard-coded and must be the same as `benchmarkServerPort` in `flutter/dev/devicelab/lib/tasks/web_benchmarks.dart`.
await sharedMain(<String>['--port', '9999']);
}