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
Kernel-based VM snapshot size will increase by 4-5x #28655
Comments
We have some hard numbers from sivachandra@ now main() { Run these commands: $> ./dart --snapshot-kind=script --snapshot=hello.snapshot_script hello.dart And then "ls -al hello*" gives this: -rw-r----- 1 sivachandra eng 38 Aug 22 19:05 hello.dart |
Up-to-date data:
As I recall though, that comparing the app-jit snapshot size isn't really apples-to-apples - for instance the tokenstreams for the platform aren't included in the "hello.snapshot_app_jit" because it's already present in the core snapshot. |
We are currently not using core snapshots for Dart 2 and instead just linking the platform.dill file into the executable. This task can only be completed when we deprecate Dart 1 and are able to remove the Dart 1 core snapshot. |
Is this required for Dart2Stable? |
Any updates here? |
This seems unconnected to the Dart 2.1 release. |
The script snapshot of Dart1 has been replaced as kernel files and the sizes of these kernel files without sources is a lot smaller than the script snapshot. The core snapshot linked by the VM has the following comparison between Dart 1 and Dart 2
Will keep this bug open to see if the size of core snapshot can be reduced. |
Fait accompli. Dart 2 is less space efficient. |
When the VM no longer consumes source (or token streams), the core snapshot needs to contain the Kernel binary of the core libs.
A dill file containing a fully linked hello world program is about 4MB today. The file essentially contains the Kernel binary of the core libraries.
The corelib snapshot with token streams today is about 1MB in size. If we remove the token stream objects (say 300kB) and add the Kernel binary instead, we will have a core snapshot that is somewhere between 4.5 to 5MB.
During development, and for debugging, that 4-5MB snapshot still does not contain sources. We'd need to add the size of source code, or keep the token streams.
We should think about how to reduce this size. A portion of the Kernel binary is unnecessary once the snapshot is loaded. For example, once a VM class object is created for a Dart class X, the Kernel representation of X is no longer needed, but it's probably not possible to delete it since it's just a portion of a large blob.
This issue is just a placeholder for us to remember to consider snapshot size.
The text was updated successfully, but these errors were encountered: