AndroidX Benchmark has two 1.6.0 alphas out: alpha01 on Oct 7, 2026 and alpha02 on Nov 18, 2026. They are small on new API surface but they change how reliable your numbers are: clock locking works on more devices, Macrobenchmark can capture heap profiles, and cold-start in-process tracing gets more consistent. Everything below comes from the official AndroidX release notes for Benchmark and Tracing, fetched today.
1. :lockClocks no longer needs root
In alpha01, the :lockClocks task uses fixed performance mode when it is available, instead of the previous root-only implementation. The notes say this allows clock locking on more physical devices, and they ask for reports of thermal throttling with the new behavior. The practical effect: a physical, non-rooted device on your CI shelf may now be able to produce steadier microbenchmark numbers. I would not assume it, though. Re-run a known benchmark a few times and compare variance before and after the upgrade.
2. MemoryProfilingConfig for Macrobenchmark
alpha01 adds MemoryProfilingConfig to ExperimentalConfig, so macrobenchmark runs can opt in to Perfetto heap profiling. The release notes give no code sample and I have not verified the constructor shape, so the snippet below shows only where the config plugs in; check the generated API docs for the real parameters.
@OptIn(ExperimentalMacrobenchmarkApi::class)
@RunWith(AndroidJUnit4::class)
class StartupBenchmark {
@get:Rule val rule = MacrobenchmarkRule()
@Test
fun startupWithHeapProfile() = rule.measureRepeated(
packageName = "com.example.app",
metrics = listOf(StartupTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD,
// pass a MemoryProfilingConfig through ExperimentalConfig here
) {
pressHome()
startActivityAndWait()
}
}
Heap profiling is the right tool when a startup regression is allocation-shaped rather than CPU-shaped, and it is the in-benchmark counterpart to the on-device profiling work covered in ProfilingManager.
3. In-process tracing from benchmarks
alpha02 (matched by Tracing 2.1.0-alpha01) lets PerfettoTraceRule enable optional categories for in-process tracing. Those categories are consumed by the TraceDriver instance in your target process. If you adopted Tracing 2.0 and emit events behind categories, you can now turn the expensive ones on only for benchmark runs.
// Test side: PerfettoTraceRule enables optional categories
// App side: the TraceDriver in the target process reads them
// (see the Tracing 2.0 post for the TraceDriver + Tracer setup)
Two related alpha02 fixes: PerfettoCapture waits for the target process to exit using am force-stop, and target packages are now killed after in-process tracing is enabled if the process was not previously alive, so cold-start traces start from a consistent state. See Jetpack Tracing 2.0 and Benchmark 1.5.0-beta01 for the groundwork.
4. Tracing 2.1.0-alpha01
The tracing release is two bug-fix items: Perfetto changed the underlying protos from the CallStack type to InlineCallStack (the notes point to the Perfetto v58.2 changelog), and the category toggle support described above. Tracing 2.0.5 (Oct 21) remains the latest stable.
5. Other alpha02 fixes worth knowing
- Thermal throttling: the logic now resets main-thread deadlines after the cooldown sleep finishes, avoiding premature time-limit errors.
- PerfettoOutput: uses buffered file streams to reduce write counts, which the notes say prevents file system exhaustion and timeouts.
- Build: the library build moved to JDK 25. This affects the library's own build, not your app.
From alpha01:
- Method trace capture is no longer sometimes skipped unnecessarily to avoid ANRs in microbenchmarks.
- Baseline profile capture is fixed for processes that do not use the
:<suffix>naming pattern. - The
Unable to flush profiles for <packagename>error is fixed. - Profiler trace links appear under a separate "Profiling Traces" section in IDE summaries.
- Method traces embedded in the system trace had a synchronization fix.
CollectBaselineProfileTasknow findstest-result.pbfiles in subdirectories, for compatibility with the new built-in test platform.
Should you upgrade?
- If you run macrobenchmarks on a physical device and fight variance, try alpha01 for the new
:lockClocksand compare run-to-run spread. - If you use
PerfettoTraceRulewith Tracing 2.0 categories, take alpha02 and Tracing 2.1.0-alpha01 together. - If you use the Baseline Profile Gradle Plugin with a multi-process app or the new built-in test platform, the alpha01 fixes are relevant.
- Keep these on a benchmark module only; they are alphas, and nothing here needs to reach your release build.
Benchmark tooling alphas carry low production risk because they live in test and benchmark modules. The cost of trying them is a CI run, and the payoff is trustworthy numbers before you chase a regression.
Source: AndroidX Benchmark and Tracing release notes (developer.android.com), retrieved Nov 28, 2026.
No comments yet. Be the first to leave one!