We spent the previous week diving deep into sharing finest practices and steering 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 you could construct a performant app.
This submit serves as your index and roadmap to revisit these sources every time you could optimize. Listed here are the 5 key takeaways from our journey collectively.
The only most impactful, low-effort change you may make is absolutely enabling the R8 optimizer. It does not simply cut back app dimension; it performs deep, whole-program optimizations to essentially rewrite your code for effectivity. Revisit your Maintain 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 may learn the full case examine on our weblog.
Engineers at Disney+ put money into app efficiency and are optimizing the app’s person expertise. Typically even seemingly small adjustments could make a huge effect. Whereas inspecting their R8 configuration, the group discovered that the -dontoptimize flag was getting used. After enabling optimizations by eradicating this flag, the Disney+ group noticed vital enhancements of their app’s efficiency.
So subsequent time somebody asks you what you might do to enhance app efficiency, simply hyperlink them to this submit.
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 recordsdata.
And to be taught extra about simply how essential Baseline Profiles are for app efficiency, learn Meta’s engineering weblog the place they shared how Baseline Profiles improved varied 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 record gadgets.Check out the newest episode of #TheAndroidShow the place we clarify this in additional element.
Learn extra in our Wednesday’s weblog: Deeper Efficiency Concerns
You may’t handle what you do not measure. Our Efficiency Leveling Information breaks down your measurement journey into 5 steps, beginning with simply obtainable knowledge and constructing as much as superior native tooling.
Beginning at degree 1, we’ll educate you use available knowledge from Android Vitals, which gives you with subject knowledge on ANRs, crashes, and extreme battery utilization.
We’ll additionally educate you degree up. For instance, we’ll show attain degree 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 studies. New options are designed that will help you confidently debug R8 and background work:
Computerized Logcat Retrace
Beginning in Android Studio Narwhal, stack traces can robotically be de-obfuscated within the Logcat window. This fashion you possibly can instantly see and debug any crashes in a production-ready construct.
Slender Maintain Guidelines
On Tuesday we demystified the Maintain Guidelines wanted to repair runtime crashes, emphasizing writing particular, member-level guidelines over overly-broad wildcards. And since it is an essential subject, we made you a video as properly.
And with the brand new lint test for extensive Maintain Guidelines, the Android Studio Otter 3 Characteristic Drop has you coated right here as properly.
We additionally launched new steering 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 Maintain Guidelines
Background Work
We shared steering on debugging frequent situations you might encounter when scheduling duties with WorkManager.
Background Activity Inspector provides 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 circumstances, serving to you obtain extra dependable execution.
Learn extra in our Wednesday’s weblog: Background work efficiency concerns
If you happen to efficiently took our problem to allow R8 full mode this week, the next step is to combine efficiency into your product roadmap utilizing the App Efficiency Rating. This standardized framework helps you discover the best leverage motion gadgets for steady enchancment.
We capped off the week with the #AskAndroid Reside Q&A session, the place engineers answered your hardest questions on R8, Profile Guided Optimizations, and extra. If you happen to missed it, search for the replay!
Thanks for becoming a member of us! Now, get constructing and preserve that momentum going.
