Skip to content
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

Build a specialized snapshot for launching the service isolate in profile mode on Android #29245

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

jason-simmons
Copy link
Member

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works on Android ATM but it should be trivial to wire up the profile AOT test harness to also generate this separate dylib and specify its path in the fixtures. That way, all host tests will use this new stuff.

@@ -116,6 +116,10 @@ struct Settings {
// case the primary path to the library can not be loaded.
std::vector<std::string> application_library_path;

// Path to a library containing compiled Dart code usable for launching
// the VM service isolate.
std::string vmservice_snapshot_library_path;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be similar to the application_library_path where a vector of paths is specified?

@@ -134,7 +134,12 @@ template("flutter_snapshot") {
"--assembly=" + rebase_path(snapshot_assembly),
]
} else if (is_android) {
libapp = "$target_gen_dir/android/libs/$android_app_abi/libapp.so"
if (defined(invoker.output_aot_lib)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output_aot_lib is a bit obscure and undocumented. Can we make this an required argument (and update existing callers) and add an assertion at the top of this template saying what this is meant to do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added documentation. I'd prefer to keep this parameter optional - in all other cases callers will be building conventional app snapshots and will want to use the default filename expected by the embedding.

@chinmaygarde
Copy link
Member

BTW, what kind of improvements were observed in the test case under investigation?

@jason-simmons
Copy link
Member Author

It looked like there was a decrease in total memory usage similar to the size of the app snapshot.

@chinmaygarde
Copy link
Member

Sounds good. Are you planning on patching the test harness in this patch?

@jason-simmons
Copy link
Member Author

Added support for the VM service snapshot in the test harness on Linux

@a-siva
Copy link
Contributor

a-siva commented Oct 27, 2021

Can this PR be merged ?

@jason-simmons jason-simmons added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Oct 27, 2021
@fluttergithubbot fluttergithubbot merged commit 6ffe788 into flutter:master Oct 27, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes needs tests platform-android waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
4 participants