dart-sdk/pkg/frontend_server
Jens Johansen 9f9da91b84 [kernel] Facilitate faster sorting of additional exports
The "additionalExports" are sorted in production code to give stable
output.
Before this CL it did `toString()` on the canonical names which is
O(n^2) because of continued string concatenation.
This CL changes it to sort on the name, going to the parent if it's the
same. This _does_ change the sorting, but should still be stable.

When compiling via the flutter frontend try bot the time spent on
sorting does from ~45 seconds to ~9 seconds (arguable still a lot, but
much better).

This will also speed up flutter testing because it will spend less time
waiting for the frontend.

TEST=Assuming existing tests.

Change-Id: If350b7c2ce49f00b2924732a7fa7eb51c38c8172
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-08-24 13:21:38 +00:00
..
bin [pkg/frontend_server] use package:lints/recommended.yaml 2023-02-10 20:29:17 +00:00
lib [kernel] Facilitate faster sorting of additional exports 2023-08-24 13:21:38 +00:00
test [frontend_server] Add --canary flag 2023-06-27 22:21:04 +00:00
analysis_options.yaml [pkg/frontend_server] use package:lints/recommended.yaml 2023-02-10 20:29:17 +00:00
LICENSE Update LICENSE 2021-04-07 10:28:38 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
pubspec.yaml Update SDK constraints for SDK packages. 2023-03-09 19:52:47 +00:00
README.md Spelling 2023-01-30 18:29:59 +00:00

The frontend_server package is used by both the flutter command line tool and the frontend_server_client package (used by webdev and package:test).

API Stability

Changes to the command line API or behavior should be tested against the following test suites (in addition to normal HHH testing):

Otherwise these changes will need to be carefully coordinated with the flutter tooling and frontend_server_client teams.

This API stability does not cover any of the source code APIs.

Stable subset

  • The frontend_server kernel compilation and expression evaluation for kernel should be considered "stable".
  • The frontend_server JavaScript compilation is semi-stable, but clients should anticipate coordinated breaking changes in the future.
  • The frontend_server JavaScript expression evaluation is experimental and is expected to change significantly from Dec 2020 through the end of 2021.
  • Specific flags like the --flutter-widget-cache may be added for experimentation and should not be considered stable.