Skip to content

Commit

Permalink
[vm] Enable new implementation of async/await in AOT mode
Browse files Browse the repository at this point in the history
The new implementation results in a much smaller overhead of
async/await on AOT snapshot size. The savings depend on
how often async/await is used.

On a large Flutter app (customer: money)
AOT snapshot size -13.7% (arm64), -12.86% (arm)

Another large Flutter app
AOT snapshot size -8.69% (arm64).

Part 1 (kernel): https://dart-review.googlesource.com/c/sdk/+/241842
Part 2 (vm): https://dart-review.googlesource.com/c/sdk/+/242000

TEST=ci

Issue: #48378
Change-Id: Idf99bb98725a1ffb21a15b111f03f5461ed2c9d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242384
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
alexmarkov authored and Commit Bot committed Apr 29, 2022
1 parent bf4bb95 commit c4c9dc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/frontend_server/lib/frontend_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class FrontendCompiler implements CompilerInterface {
nullSafety: compilerOptions.nnbdMode == NnbdMode.Strong,
supportMirrors: options['support-mirrors'] ??
!(options['aot'] || options['minimal-kernel']),
compactAsync: options['compact-async'] ?? false /*options['aot']*/,
compactAsync: options['compact-async'] ?? options['aot'],
);
if (compilerOptions.target == null) {
print('Failed to create front-end target ${options['target']}.');
Expand Down
2 changes: 1 addition & 1 deletion pkg/vm/lib/kernel_front_end.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Future<int> runCompiler(ArgResults options, String usage) async {
final String? manifestFilename = options['manifest'];
final String? dataDir = options['component-name'] ?? options['data-dir'];
final bool? supportMirrors = options['support-mirrors'];
final bool compactAsync = options['compact-async'] ?? false /*aot*/;
final bool compactAsync = options['compact-async'] ?? aot;

final bool minimalKernel = options['minimal-kernel'];
final bool treeShakeWriteOnlyFields = options['tree-shake-write-only-fields'];
Expand Down

0 comments on commit c4c9dc5

Please sign in to comment.