
Posted by Alice Yuan – Senior Developer Relations Engineer

Welcome to day 4 of Efficiency Highlight Week. Now that you’ve got discovered about among the superior instruments and greatest practices we have launched not too long ago such because the R8 Optimizer, and Profile Guided Optimization with Baseline Profiles and Startup Profiles, you could be questioning the place to begin your efficiency enchancment journey.
We have give you a step-by-step efficiency leveling information to fulfill your cell growth staff the place you’re—whether or not you are an app with a single developer seeking to get began with efficiency, or you might have a whole staff devoted to enhancing Android efficiency.
The efficiency leveling information options 5 ranges. We’ll begin with stage 1, which introduces minimal adoption effort efficiency tooling, and we’ll go as much as stage 5, very best for apps which have the resourcing to keep up a bespoke efficiency framework.
Be happy to leap to the extent that resonates most with you:
We advocate first leveraging Android vitals inside the Play Console for viewing routinely collected subject monitoring information, supplying you with insights about your utility with minimal effort.
Android vitals is Google’s initiative to routinely acquire and floor this subject information for you.
This is a proof of how we ship this information:
Accumulate Information: When a person opts-in, their Android system routinely logs key efficiency and stability occasions from all apps, together with yours.
Mixture Information: Google Play collects and anonymizes this information out of your app’s customers.
Floor Insights: The info is introduced to you within the Android vitals dashboard inside your Google Play Console.
The Android vitals dashboard tracks many metrics, however a couple of are designated as Core Vitals. These are an important as a result of they will have an effect on your app’s visibility and rating on the Google Play Retailer.
The Core Vitals
|
GOOGLE PLAY’S CORE TECHNICAL QUALITY METRICS To maximise visibility on Google Play, preserve your app under the unhealthy conduct thresholds for these metrics. | |
|---|---|
| Person-perceived crash charge | The share of day by day lively customers who skilled not less than one crash that’s more likely to have been noticeable |
| Person-perceived ANR charge | The share of day by day lively customers who skilled not less than one ANR that’s more likely to have been noticeable |
| Extreme battery utilization | The share of watch face periods the place battery utilization exceeds 4.44% per hour |
| New: Extreme partial wake locks | The share of person periods the place cumulative, non-exempt wake lock utilization exceeds 2 hours |
The core vitals embody user-perceived crash charge, ANR charge, extreme battery utilization and the newly launched metric on extreme partial wake locks.
Person-Perceived ANR Charge
You need to use the Android Vitals ANR dashboard, to see stack traces of points that happen within the subject and get insights and proposals on methods to repair the difficulty.

You’ll be able to drill down into a selected ANR that occurred, to see the stack hint in addition to insights on what could be inflicting the difficulty.
Additionally, try our ANR steerage that can assist you diagnose and repair the widespread eventualities the place ANRs may happen.
Person-Perceived Crash Charge
Use the Android vitals crflevelash dashboard to additional debug crashes and think about a pattern of stack traces that happen inside your app.
Our documentation additionally has steerage round troubleshooting particular crashes. For instance, the Troubleshoot foreground providers information discusses methods to determine and repair widespread eventualities the place crashes happen.
Extreme Battery Utilization
To lower watch face periods with extreme battery utilization on Put on OS, try the Put on information on methods to enhance and preserve battery.
[new] Extreme Partial Wake Locks
We not too long ago introduced that apps that exceed the extreme partial wake locks threshold might even see further remedy beginning on March 1st 2026.
For cell gadgets, the Android vitals metric applies to non-exempted wake locks acquired whereas the display is off and the app is within the background or operating a foreground service. Android vitals considers partial wake lock utilization extreme if wake locks are held for not less than two hours inside a 24-hour interval and it impacts greater than 5% of your app’s periods, averaged over 28 days.
To debug and repair extreme wake lock points, try our technical weblog publish.
Seek the advice of our Android vitals documentation and proceed your journey to raised leverage Android vitals.
Subsequent, transfer onto utilizing the App Efficiency Rating to seek out the excessive leverage motion gadgets to uplevel your app efficiency.
The Android App Efficiency Rating is a standardized framework to measure your app’s technical efficiency. It offers you a rating between 0 and 100, the place a decrease quantity signifies extra room for enchancment.
To get simple wins, you must first begin with the Static Efficiency Rating first. These are sometimes configuration modifications or tooling updates that present vital efficiency boosts.
Step 1: Carry out the Static Evaluation
The static evaluation evaluates your venture’s configuration and tooling adoption. These are sometimes the quickest methods to enhance efficiency.
Navigate to the Static Rating part of the scoreboard web page and do the next:
Assess Android Gradle Plugin (AGP) Model.
Undertake R8 Minification incrementally or ideally, use R8 in full mode to minify and optimize the app code.
Undertake Baseline Profiles which improves code execution velocity from the primary launch offering efficiency enhancements for each new app set up and each app replace.
Undertake Startup Profiles to enhance Dex Structure. Startup Profiles are utilized by the construct system to additional optimize the courses and strategies they include by enhancing the format of code in your APK’s DEX recordsdata.
Improve to the latest model of Jetpack Compose
Step 2: Carry out the Dynamic Evaluation
Upon getting utilized the static simple wins, use the dynamic evaluation to validate the enhancements on an actual system. You’ll be able to first do that manually with a bodily system and a cease watch.
Navigate to the Dynamic Rating part of the scoreboard web page and do the next:
Arrange your take a look at setting with a bodily system. Think about using a lower-end system to magnify efficiency points, making them simpler to identify.
Measure startup time from the launcher. Chilly begin your app from the launcher icon and measure the time till it’s interactive.
Measure app startup time from a notification, with the objective to cut back notification startup time to be under a pair seconds.
Measure rendering efficiency by scrolling via your core screens and animations.
As soon as you’ve got accomplished these steps, you’ll obtain a rating between 1 – 100 for the static and dynamic scores, supplying you with an understanding of your app’s efficiency and the place to concentrate on.
As soon as you’ve got began to evaluate dynamic efficiency, it’s possible you’ll discover it too tedious to measure efficiency manually. Take into account automating your efficiency testing utilizing efficiency take a look at frameworks reminiscent of Macrobenchmarks and UiAutomator.
Macrobenchmark 💚 UiAutomator
Consider Macrobenchmark and UiAutomator as two instruments that work collectively: Macrobenchmark is the measurement device. It is like a stopwatch and a frame-rate counter that runs outdoors your app. It’s answerable for beginning your app, recording metrics (like startup time or dropped frames), and stopping the app. UiAutomator is the robotic person. The library permits you to write code to work together with the system’s display. It may discover an icon, faucet a button, scroll on a listing and extra.
How you can write a take a look at
Once you write a take a look at, you wrap your UiAutomator code inside a Macrobenchmark block.
Outline the Take a look at: Use the @MacrobenchmarkRule
Begin Measuring: Name benchmarkRule.measureRepeated.
Drive the UI: Inside that block, use UiAutomator code to launch your app, discover UI components, and work together with them.
This is an instance code snippet of what it appears to be like like to check a compose checklist for scrolling jank.
benchmarkRule.measureRepeated(
// …
metrics = listOf(
FrameTimingMetric(),
),
startupMode = StartupMode.COLD,
iterations = 10,
) {
// 1. Launch the app’s primary exercise
startApp()
// 2. Discover the checklist utilizing its useful resource ID and scroll down
onElement { viewIdResourceName == “$packageName.my_list” }
.fling(Path.DOWN)
}
Overview the outcomes: Every take a look at run offers you with exactly measured data to provide the greatest information in your app’s efficiency.
timeToInitialDisplayMs min 1894.4, median 2847.4, max 3355.6
frameOverrunMs P50 -3.2, P90 6.2, P95 10.4, P99 119.5
Frequent use circumstances
Macrobenchmark offers a number of core metrics out of the field. StartupTimingMetric permits you to precisely measure app startup. The FrameTimingMetric lets you perceive an app’s rendering efficiency in the course of the take a look at.
We have now an in depth and full information to utilizing Macrobenchmarks and UiAutomator alongside code samples accessible so that you can proceed studying.
Hint evaluation instruments like Perfetto are used when it is advisable see past your personal utility code. In contrast to commonplace debuggers or profilers that solely see your course of, Perfetto captures the complete system state—kernel scheduling, CPU frequency, different processes, and system providers—supplying you with full context for efficiency points.
Test our Efficiency Debugging youtube playlist for video directions on efficiency debugging utilizing system traces, Android Studio Profiler and Perfetto.
How you can use Perfetto to debug efficiency
The overall workflow for debugging efficiency utilizing hint evaluation instruments is to file, load and analyze the hint.
Step 1: Document a hint
You’ll be able to file a system hint utilizing a number of strategies:
Step 2: Load the hint
Upon getting the hint file, it is advisable load it into the evaluation device.
Open Chrome and navigate to ui.perfetto.dev.
Drag and drop your .perfetto-trace (or .pftrace) file straight into the browser window.
The UI will course of the file and show the timeline.
Step 3: Analyze the hint
You need to use Perfetto UI or Android Studio Profiler to analyze efficiency points. Take a look at this episode of the MAD Expertise collection on Efficiency, the place our efficiency engineer Carmen Jackson discusses the Perfetto traceviewer.
Eventualities for inspecting system traces utilizing Perfetto
Perfetto is an skilled device and might present details about the whole lot that occurred on the Android system whereas a hint was captured. That is significantly useful whenever you can not determine the foundation reason behind a slowdown utilizing commonplace logs or primary profilers.
Debugging Jank (Dropped Frames)
In case your app stutters whereas scrolling, Perfetto can present you precisely why a selected body missed its deadline.
If it’s because of the app, you may see your primary thread operating for a protracted period doing heavy parsing; this means eventualities the place you must transfer the work into asynchronous processing.
If it’s because of the system, you may see your primary thread able to run, however the CPU kernel scheduler gave precedence to a unique system service, leaving your app ready (CPU rivalry). This means eventualities the place it’s possible you’ll must optimize utilization of platform APIs.
Analyzing Gradual App Startup
Startup is complicated, involving system init, course of forking, and useful resource loading. Perfetto visualizes this timeline exactly.
You’ll be able to see if you’re ready on Binder calls (inter-process communication). In case your onCreate waits a very long time for a response from the system PackageManager, Perfetto will present that blocked state clearly.
You can even see in case your app is doing extra work than essential in the course of the app startup. For instance, if you’re creating and laying out extra views than the app wants to indicate, you may see these operations within the hint.
Investigating Battery Drain & CPU Utilization
As a result of Perfetto sees the entire system, it is good for locating invisible energy drains.
You’ll be able to determine which processes are holding wake locks, stopping the system from sleeping below the “Machine State” tracks. Be taught extra in our wake locks weblog publish. Additionally, use Perfetto to see in case your background jobs are operating too often or waking up the CPU unnecessarily.
The ultimate stage is for apps which have groups with resourcing to keep up a efficiency monitoring framework.
Constructing a customized efficiency monitoring framework on Android entails leveraging a number of system APIs to seize information all through the appliance lifecycle, from startup to exit, and through particular high-load eventualities.
Through the use of ApplicationStartInfo, ProfilingManager, and ApplicationExitInfo, you may create a sturdy telemetry system that experiences on how your app began, detailed information on what it did whereas operating, and why it died.
ApplicationStartInfo: Monitoring how the app began
Obtainable from Android 15 (API 35), ApplicationStartInfo offers detailed metrics about app startup within the subject. The info consists of whether or not it was a chilly, heat, or sizzling begin, and the period of various startup phases.
This helps you develop a baseline startup metric utilizing manufacturing information to additional optimize that could be laborious to breed domestically. You need to use these metrics to run A/B checks optimizing the startup move.
The objective is to precisely file launch metrics with out manually instrumenting each initialization part.
You’ll be able to question this information lazily a while after utility launch.
ProfilingManager: Capturing why it was gradual
ProfilingManager (API 35) permits your app to programmatically set off system traces on person gadgets. That is highly effective for catching transient efficiency points within the wild you could’t reproduce domestically.
The objective is to routinely file a hint when a selected extremely essential person journey is detected as operating slowly or experiencing efficiency points.
You’ll be able to register a listener that triggers when particular situations are met or set off it manually whenever you detect a efficiency concern reminiscent of jank, extreme reminiscence, or battery drain.
Test our documentation on methods to seize a profile,
retrieve and analyze profiling information and use debug instructions.
ApplicationExitInfo: Monitoring why the app died
ApplicationExitInfo (API 30) tells you why your earlier course of died. That is essential for locating native crashes, ANRs, or system kills on account of extreme reminiscence utilization (OOM). You will additionally be capable to get an in depth tombstone hint through the use of the API getTraceInputStream.
The objective of the API is to grasp stability points that do not set off commonplace Java crash reporters (like Low Reminiscence Kills).
You need to set off this API on the following app launch.
Enhancing Android efficiency is a step-by-step journey. We’re so excited to see the way you stage up your efficiency utilizing these instruments!
Tune in tomorrow for Ask Android
You could have shrunk your app with R8 and optimized your runtime with Profile Guided Optimization. And measure your app’s efficiency.
Be part of us tomorrow for the reside Ask Android session. Ask your questions now utilizing #AskAndroid and get them answered by the specialists.
