Skip to content

AOT snapshot size regression with --preview-dart-2 on Flutter Gallery. #30616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mraleph opened this issue Sep 4, 2017 · 4 comments
Closed
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. front-end-kernel legacy-area-front-end Legacy: Use area-dart-model instead.

Comments

@mraleph
Copy link
Member

mraleph commented Sep 4, 2017

@aam reports that AOT snapshot size is 300K larger

@mraleph mraleph added area-kernel area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Sep 4, 2017
whesse pushed a commit that referenced this issue Sep 12, 2017
Omit kernel function bodies when writing AOT snapshot. Saves 2.7MB (16%) on the snapshot size of Flutter Gallery.

Bug: #30616
Change-Id: I7ab40d13e43607fe7c68670f8e923807b9cea37f
Reviewed-on: https://dart-review.googlesource.com/5220
Reviewed-by: Vyacheslav Egorov <[email protected]>
Reviewed-by: Siva Chandra <[email protected]>
@askeksa-google
Copy link

The kernel snapshot contained the kernel data for all function bodies. Omitting this took care of most of the extra size of the Isolate data:

  • Source snapshot size: 2632473
  • Kernel snapshot size before: 5599063
  • Kernel snapshot size after: 2744877

This still leaves the 300k extra instructions (7503920 vs 7208448). It seems this difference is mainly due to the kernel snapshot containing more functions (19855 vs 19011).

There are many small differences between the function sets. One big difference is in the number of anonymous closure functions (1917 vs 1115). The majority of these seem to be coming from asserts in initializer lists. Every assert in an initializer list produces a closure when going through kernel.

@aam
Copy link
Contributor

aam commented Sep 14, 2017

With today's update of flutter, the Dart change reached flutter benchmarks and you can see nice impact it made there: https://flutter-dashboard.appspot.com/benchmarks.html

@a-siva
Copy link
Contributor

a-siva commented Oct 17, 2017

@askeksa-google The snapshot size as reported above is close to the size reported from the source based snapshot, can we close this issue?

@askeksa-google
Copy link

Yes. The main remaining difference is the 300k extra instructions, which seem to be mainly due to asserts in initializers. There is a separate issue for that: #30914

@kmillikin kmillikin added legacy-area-front-end Legacy: Use area-dart-model instead. front-end-kernel and removed legacy-area-front-end Legacy: Use area-dart-model instead. labels Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. front-end-kernel legacy-area-front-end Legacy: Use area-dart-model instead.
Projects
None yet
Development

No branches or pull requests

5 participants