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

Add baseline profile generation #5414

Merged

Conversation

Isira-Seneviratne
Copy link
Collaborator

Add module for generating a baseline profile for the app.

@IndusAryan
Copy link
Contributor

IndusAryan commented Jan 1, 2024

wow, pr so advanced that i couldn't understand what the code is doing (ik making app fast somehow) and the pixel props included (for what?), maybe @RafaelsRamos can drop his 2 cents here with good explanation.

@Isira-Seneviratne
Copy link
Collaborator Author

Isira-Seneviratne commented Jan 1, 2024

wow, pr so advanced that i couldn't understand what the code is doing (ik making app fast somehow) and the pixel props included (for what?), maybe @RafaelsRamos can drop his 2 cents here with good explanation.

It allows a profile of methods called during startup to be generated, so that they can be compiled ahead of time to improve startup and overall performance on Android 7.0 and later: https://android-developers.googleblog.com/2022/01/improving-app-performance-with-baseline.html

@IndusAryan
Copy link
Contributor

IndusAryan commented Jan 1, 2024

i understood now, but why pixel virtual device prop is needed for tests and why source compat and jvm target of baseline is not jdk 17 (LTS) but 1_8 ,different from Libretube

@RafaelsRamos
Copy link
Contributor

The source compact can be 17, it defaulted to 1_8 because Android Studio generated it this way (it is probably a good idea to change it to 17 for consistency).

Regarding the virtual device, the way the baseline profile generates the profiles, is by pre-compiling classes and methods from flows we want him to optimize (startup on this PR). This must be done on rooted devices (rooted emulators or physical devices).

The reason why we want it on an emulator is because it should be ran before a new release, so adding it to the release pipeline would be the ultimate goal.

@RafaelsRamos
Copy link
Contributor

Question - While generating the baseline-prof.txt I see that the content is not obfuscated. Did you use the nonMinifiedRelease build variant?

I see that Google suggests using a .pro file with -dontobfuscate, but it does not seem to work 🤔

@Isira-Seneviratne
Copy link
Collaborator Author

Isira-Seneviratne commented Jan 4, 2024

Question - While generating the baseline-prof.txt I see that the content is not obfuscated. Did you use the nonMinifiedRelease build variant?

Yeah, the profile generation does that: https://developer.android.com/topic/performance/baselineprofiles/create-baselineprofile

I see that Google suggests using a .pro file with -dontobfuscate, but it does not seem to work 🤔

There's already a -dontobfuscate rule in the project's ProGuard file.

@Isira-Seneviratne Isira-Seneviratne marked this pull request as ready for review January 4, 2024 02:23
@Isira-Seneviratne Isira-Seneviratne merged commit 2767f4d into libre-tube:master Jan 9, 2024
3 of 4 checks passed
@Isira-Seneviratne Isira-Seneviratne deleted the Baseline-profile branch January 9, 2024 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants