Skip to content

Conversation

@aubynsamuel
Copy link
Contributor

🚀 What’s New
This PR integrates Baseline Profiles into the project to significantly enhance app performance. By allowing the Android Runtime (ART) to pre-optimize critical code paths during installation, this results in:

⚡ Faster cold and warm startups
🧈 Smoother scrolling
🎞️ More fluid UI animations
📲 Snappier screen transitions and navigation
This improvement is particularly noticeable on lower-end and mid-tier devices, leading to a better initial user experience.

🎯 What’s Included
✅ Integration of the profileinstaller library.
✅ Project configuration to collect and package the baseline profile for optimization.
Note: The baseline-prof.txt file, which defines the critical code paths, needs to be generated using the steps below.

🛠️ How to Generate and Use the Baseline Profile

Configure Baseline Profile Generation:

Go to Run/Debug Configurations.
Click the + icon and select Android Baseline Profile.
Choose your app module.
Ensure "Generate Baseline Profile for all variants" is selected.
Click Apply and then OK.
Generate the Baseline Profile:

Run the newly created Baseline Profile configuration (make sure a device or emulator is connected). This will run instrumentation tests to capture key interactions and generate the baseline-prof.txt file.
Build with the Baseline Profile:

Switch the build variant in Android Studio to benchmarkRelease.
Build or generate an APK/AAB. This build will now include the generated Baseline Profile for optimization.

@nsh07
Copy link
Owner

nsh07 commented Jun 2, 2025

Thank you so much for the new PR!

Build was failing with the older name with the uppercase P
@nsh07
Copy link
Owner

nsh07 commented Jun 2, 2025

Everything seems to be fine with this PR, I've just modified the baselineprofile directory with a small P because the build was failing on Linux (probably because of the case-sensitive filesystem).

Merging this. Thanks for your contribution!

@nsh07 nsh07 merged commit 403bbd0 into nsh07:dev Jun 2, 2025
@nsh07
Copy link
Owner

nsh07 commented Jun 2, 2025

I just ran the benchmarks:

image

The app now starts 28.13% faster than before :)

@aubynsamuel
Copy link
Contributor Author

I’m really glad the Baseline Profile made such an impact! Thanks for confirming the results.

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.

2 participants