-
Notifications
You must be signed in to change notification settings - Fork 738
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
Baseline and Startup Profiles #8884
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: javernaut <[email protected]>
|
Signed-off-by: javernaut <[email protected]>
9da3a3c
to
53a536e
Compare
Signed-off-by: javernaut <[email protected]>
53a536e
to
5e8dd03
Compare
Hello @bmarty , |
…generating and benchmarking Signed-off-by: javernaut <[email protected]>
Signed-off-by: javernaut <[email protected]>
5e8dd03
to
8746edf
Compare
Hi @bmarty, @BillCarsonFr Could you please have a look at this PR? I forgot setting element-android-reviewers as a reviewer while creating the PR and it doesn't seem possible to set it after the PR is created. It would be nice to have this feature discussed/integrated into Element Android. After that I would look into integrating the same thing for Element X Android. |
Type of change
Content
Adding the Baseline and Startup profiles generation module and actually generated profiles.
Motivation and context
Both Baseline and Startup profiles provide relatively cheap boosting of cold app starting:
Nowadays creating of these profiles is mostly automated by Androidx's Baseline Profile Gradle Plugin. Android Studio has a template for a standalone Gradle module, which encapsulates the majority of BP management logic. The generating of the profiles can be done automatically with emulators as Gradle Managed Devices, but the benchmarking is highly recommended to perform on physical devices.
This PR consists of:
:baselineprofile
module, generated from the template with almost no tweaks. The only focus for improvement was the startup time. Other critical flows can be improved the same way, but are outside of the scope of this PR. The module provides a way for BP generation and benchmarking;fdroidRelease
,gplayRelease
andgplayNightly
.During the integration it turned out that BP had a lot of raw edges. There were some critical issues affecting the integration into Element app:
These issueas are fixed by now and the only sustainable minimum versions of tools which provide adequate experience are:
Yes, some issues come from AGP itself, so it is updated. Minor build scripts' changes were done because of it.
How exactly does this PR improve the startup time?
The numbers highly depend on a physical device used for benchmarks and the state such a device is in. Tests done right after a reboot show better results than in case when a device works for days and have many apps running in a background. Some devices won't run benchmark tests at all (some Oneplus devices).
I used several devices for benchmarking:
Actual benchmark results:
Oneplus 8T
Samsung S20 FE 5G
Samsung Galaxy Tab A7
How can the profiles be generated?
With a simple command:
./gradlew :vector-app:generateBaselineProfile
.The process uses Gradle Managed Devices to use a specific android emulator (Pixel 6, API 34), so no active emulator or physical device is required for profile generation.
What are the cons?
src
directory cluttering: these directories contain actual BP and slightly hinder the persepiton of the immediate children ofsrc
;Tested devices
Checklist