We spent the previous week diving deep into sharing finest practices and steerage that helps to make Android apps quicker, smaller, and extra steady. From the foundational powers of the R8 optimizer and Profile Guided Optimizations, to efficiency enhancements with Jetpack Compose, to a brand new information on levelling up your app’s efficiency, we have coated the low effort, excessive influence instruments it’s good to construct a performant app.
This put up serves as your index and roadmap to revisit these assets each time it’s good to optimize. Listed below are the 5 key takeaways from our journey collectively.
The only most impactful, low-effort change you can also make is absolutely enabling the R8 optimizer. It does not simply scale back app measurement; it performs deep, whole-program optimizations to basically rewrite your code for effectivity. Revisit your Preserve Guidelines and get R8 again into your engineering duties.
Our newly up to date and expanded documentation on the R8 optimizer is right here to assist.
Reddit noticed a 40% quicker chilly startup and 30% fewer ANR errors after enabling R8 full mode.
You’ll be able to learn the full case examine on our weblog.
Engineers at Disney+ spend money on app efficiency and are optimizing the app’s consumer expertise. Generally even seemingly small modifications could make a huge effect. Whereas inspecting their R8 configuration, the staff discovered that the -dontoptimize flag was getting used. After enabling optimizations by eradicating this flag, the Disney+ staff noticed vital enhancements of their app’s efficiency.
So subsequent time somebody asks you what you would do to enhance app efficiency, simply hyperlink them to this put up.
Learn extra in our Day 1 weblog: Use R8 to shrink, optimize, and fast-track your app
Baseline Profiles successfully take away the necessity for Simply in Time compilation, enhancing startup pace, scrolling, animation and general rendering efficiency. Startup Profiles make app startup extra much more light-weight by bringing an clever order to your app’s lessons.dex information.
And to be taught extra about simply how vital Baseline Profiles are for app efficiency, learn Meta’s engineering weblog the place they shared how Baseline Profiles improved numerous important efficiency metrics by as much as 40% throughout their apps.
We proceed to make Jetpack Compose extra performant for you in Jetpack Compose 1.10. Options like pausable composition and the customizable cache window are essential for sustaining zero scroll jank when coping with complicated listing objects.Check out the most recent episode of #TheAndroidShow the place we clarify this in additional element.
Learn extra in our Wednesday’s weblog: Deeper Efficiency Issues
You’ll be able to’t handle what you do not measure. Our Efficiency Leveling Information breaks down your measurement journey into 5 steps, beginning with simply out there knowledge and constructing as much as superior native tooling.
Beginning at stage 1, we’ll educate you learn how to use available knowledge from Android Vitals, which supplies you with discipline knowledge on ANRs, crashes, and extreme battery utilization.
We’ll additionally educate you learn how to stage up. For instance, we’ll show learn how to attain stage 3 with native efficiency testing utilizing Jetpack Macrobenchmark and the brand new UiAutomator 2.4 API to precisely measure and confirm any change in your app’s efficiency.
Learn extra in our Thursday’s weblog
Superior optimization should not imply unreadable crash stories. New options are designed that will help you confidently debug R8 and background work:
Automated Logcat Retrace
Beginning in Android Studio Narwhal, stack traces can routinely be de-obfuscated within the Logcat window. This manner you may instantly see and debug any crashes in a production-ready construct.
Slender Preserve Guidelines
On Tuesday we demystified the Preserve Guidelines wanted to repair runtime crashes, emphasizing writing particular, member-level guidelines over overly-broad wildcards. And since it is an vital subject, we made you a video as effectively.
And with the brand new lint examine for vast Preserve Guidelines, the Android Studio Otter 3 Characteristic Drop has you coated right here as effectively.
We additionally launched new steerage on testing and troubleshooting your R8 configuration that will help you get the configuration proper with confidence.
Learn extra in our Tuesday’s weblog: Configure and troubleshoot R8 Preserve Guidelines
Background Work
We shared steerage on debugging widespread eventualities you could encounter when scheduling duties with WorkManager.
Background Activity Inspector offers you a visible illustration and graph view of WorkManager duties, serving to debug why scheduled work is delayed or failed. And our refreshed Background Work documentation touchdown web page highlights task-specific APIs which are optimized for explicit use instances, serving to you obtain extra dependable execution.
Learn extra in our Wednesday’s weblog: Background work efficiency issues
For those who efficiently took our problem to allow R8 full mode this week, the next move is to combine efficiency into your product roadmap utilizing the App Efficiency Rating. This standardized framework helps you discover the very best leverage motion objects for steady enchancment.
We capped off the week with the #AskAndroid Dwell Q&A session, the place engineers answered your hardest questions on R8, Profile Guided Optimizations, and extra. For those who missed it, search for the replay!
Thanks for becoming a member of us! Now, get constructing and maintain that momentum going.
