Testing 5 min read

Benchmark 1.6.0 Alphas: Fixed-Performance :lockClocks, Heap Profiling in Macrobenchmark and Cold-Start Tracing Fixes

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.

alpha01
Oct 7, 2026: lockClocks, MemoryProfilingConfig
alpha02
Nov 18, 2026: bug fixes only
2.1.0-alpha01
Tracing, same day as alpha02

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

From alpha01:

Should you upgrade?

  1. If you run macrobenchmarks on a physical device and fight variance, try alpha01 for the new :lockClocks and compare run-to-run spread.
  2. If you use PerfettoTraceRule with Tracing 2.0 categories, take alpha02 and Tracing 2.1.0-alpha01 together.
  3. 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.
  4. 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.

Comments 0

No comments yet. Be the first to leave one!

Leave a comment