Skip to content

Commit

Permalink
[vm/aot] Enable tree-shaking of write-only fields by default
Browse files Browse the repository at this point in the history
Tree-shaking of write only fields is implemented in
https://dart-review.googlesource.com/c/sdk/+/143286
This change just enables it by default.

Flutter gallery in release mode
armv7 app.so size -0.41% (gzip -0.24%, brotli -0.20%)
armv8 app.so size -0.38% (gzip -0.23%, brotli -0.29%)

Issue: #35310

Change-Id: Iaae3e893b4a6bf4d468d6cd05aba5f8ee8810afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148543
Reviewed-by: Ryan Macnak <[email protected]>
Commit-Queue: Alexander Markov <[email protected]>
  • Loading branch information
alexmarkov authored and [email protected] committed May 21, 2020
1 parent 7b3ce0d commit 9c50efc
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 @@ -60,7 +60,7 @@ ArgParser argParser = ArgParser(allowTrailingOptions: true)
defaultsTo: false)
..addFlag('tree-shake-write-only-fields',
help: 'Enable tree shaking of fields which are only written in AOT mode.',
defaultsTo: false)
defaultsTo: true)
..addFlag('protobuf-tree-shaker',
help: 'Enable protobuf tree shaker transformation in AOT mode.',
defaultsTo: false)
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 @@ -102,7 +102,7 @@ void declareCompilerOptions(ArgParser args) {
defaultsTo: true);
args.addFlag('tree-shake-write-only-fields',
help: 'Enable tree shaking of fields which are only written in AOT mode.',
defaultsTo: false);
defaultsTo: true);
args.addFlag('protobuf-tree-shaker',
help: 'Enable protobuf tree shaker transformation in AOT mode.',
defaultsTo: false);
Expand Down

0 comments on commit 9c50efc

Please sign in to comment.