AndroidX Benchmark

Frameworks & LibrariesAI extracted

AndroidX's Microbenchmark and Macrobenchmark libraries and Gradle plugin, for measuring code and app startup.

Latest 1.6.0-alpha02 · by GoogleWebsiteRSS

Release activity

Release activity — 13 releases across 13 days in the last year. Each cell is one day; darker means more releases that day. Older weeks are hidden at this screen width.
AugSepOctNov
SundayNo releases on Aug 2, 2026No releases on Aug 9, 2026No releases on Aug 16, 2026No releases on Aug 23, 2026No releases on Aug 30, 2026No releases on Sep 6, 2026No releases on Sep 13, 2026No releases on Sep 20, 2026No releases on Sep 27, 2026No releases on Oct 4, 2026No releases on Oct 11, 2026No releases on Oct 18, 2026No releases on Oct 25, 2026No releases on Nov 1, 2026No releases on Nov 8, 2026No releases on Nov 15, 2026
MondayNo releases on Aug 3, 2026No releases on Aug 10, 2026No releases on Aug 17, 2026No releases on Aug 24, 2026No releases on Aug 31, 2026No releases on Sep 7, 2026No releases on Sep 14, 2026No releases on Sep 21, 2026No releases on Sep 28, 2026No releases on Oct 5, 2026No releases on Oct 12, 2026No releases on Oct 19, 2026No releases on Oct 26, 2026No releases on Nov 2, 2026No releases on Nov 9, 2026No releases on Nov 16, 2026
TuesdayNo releases on Aug 4, 2026No releases on Aug 11, 2026No releases on Aug 18, 2026No releases on Aug 25, 2026No releases on Sep 1, 2026No releases on Sep 8, 2026No releases on Sep 15, 2026No releases on Sep 22, 2026No releases on Sep 29, 2026No releases on Oct 6, 2026No releases on Oct 13, 2026No releases on Oct 20, 2026No releases on Oct 27, 2026No releases on Nov 3, 2026No releases on Nov 10, 2026No releases on Nov 17, 2026
WednesdayNo releases on Aug 5, 20261 release on Aug 12, 2026No releases on Aug 19, 20261 release on Aug 26, 2026No releases on Sep 2, 20261 release on Sep 9, 2026No releases on Sep 16, 2026No releases on Sep 23, 2026No releases on Sep 30, 20261 release on Oct 7, 2026No releases on Oct 14, 2026No releases on Oct 21, 2026No releases on Oct 28, 2026No releases on Nov 4, 2026No releases on Nov 11, 20261 release on Nov 18, 2026
ThursdayNo releases on Aug 6, 2026No releases on Aug 13, 2026No releases on Aug 20, 2026No releases on Aug 27, 2026No releases on Sep 3, 2026No releases on Sep 10, 2026No releases on Sep 17, 2026No releases on Sep 24, 2026No releases on Oct 1, 2026No releases on Oct 8, 2026No releases on Oct 15, 2026No releases on Oct 22, 2026No releases on Oct 29, 2026No releases on Nov 5, 2026No releases on Nov 12, 2026No releases on Nov 19, 2026
FridayNo releases on Aug 7, 2026No releases on Aug 14, 2026No releases on Aug 21, 2026No releases on Aug 28, 2026No releases on Sep 4, 2026No releases on Sep 11, 2026No releases on Sep 18, 2026No releases on Sep 25, 2026No releases on Oct 2, 2026No releases on Oct 9, 2026No releases on Oct 16, 2026No releases on Oct 23, 2026No releases on Oct 30, 2026No releases on Nov 6, 2026No releases on Nov 13, 2026
SaturdayNo releases on Aug 8, 2026No releases on Aug 15, 2026No releases on Aug 22, 2026No releases on Aug 29, 2026No releases on Sep 5, 2026No releases on Sep 12, 2026No releases on Sep 19, 2026No releases on Sep 26, 2026No releases on Oct 3, 2026No releases on Oct 10, 2026No releases on Oct 17, 2026No releases on Oct 24, 2026No releases on Oct 31, 2026No releases on Nov 7, 2026No releases on Nov 14, 2026

13 releases in the last year

Changelog

1.6.0-alpha02

Latest
Added 1
  • Add support for toggling optional categories when enabling in-process tracing for a target process, used by the TraceDriver instance in the target process
Changed 4
  • PerfettoCapture waits for target process exit using am force-stop to ensure process stability during benchmarks
  • PerfettoOutput buffers file streams to reduce total write counts and prevent file system exhaustion and timeouts
  • Updated AndroidX test library dependencies and fixed javadoc warning configurations
  • Transitioned build environment to JDK 25 with workarounds for compatibility, including JSpecify annotation removals and native access flags
Fixed 3
  • Reset main thread deadlines after the thermal throttle cooldown sleep completes to avoid premature time limit errors
  • Corrected restricted API surface labels in metalava configuration so they align with atomic and non-atomic group definitions
  • Target packages are killed after in-process tracing is enabled when the process was not previously alive, maintaining consistent cold-start tracing states

From AndroidX Benchmark

Add support for toggling categories when enabling in-process tracing from benchmarks for a target process. PerfettoTraceRule now supports enabling optional categories for in-process tracing. These categories are used by the TraceDriver instance in the target process. ( I663ed, b/565040771) Fixed thermal throttle logic to reset main thread deadlines after the cooldown sleep completes to avoid premature time limit errors. ( Ibb2f02) Swapped restricted API surface labels in metalava configuration to correctly align with atomic and non-atomic group definitions. ( I0c563c, b/582384448) Updated PerfettoCapture to wait for target process exit using am force-stop to ensure process stability during benchmarks. ( If8a631) Buffered file streams in PerfettoOutput to reduce total write counts and prevent file system exhaustion and timeouts. ( I1c828c) Updated AndroidX test library dependencies and fixed javadoc warning configurations to maintain build stability. ( Ia7e3ff) Transitioned build environment to JDK 25 and added necessary workarounds for compatibility, including JSpecify annotation removals and native access flags. ( I88704c, b/559834169, b/445484245) Ensured target packages are killed after in-process tracing is enabled when the process was not previously alive to maintain consistent cold-start tracing states. ( Icef99b, b/568496084)

View originalPermalink
How 1.6.0-alpha02 went

1.6.0-alpha01

Added 1
  • MemoryProfilingConfig is added to ExperimentalConfig to allow macrobenchmark runs to opt into Perfetto heap profiling
Changed 3
  • The benchmark :lockClocks task now uses fixed performance mode when available, instead of the previous root-only implementation, allowing clocks to be locked on many more physical devices
  • Profiler trace links are now reported under a separate 'Profiling Traces' section in IDE summaries
  • CollectBaselineProfileTask in the Baseline Profile Gradle Plugin now supports finding test-result.pb files in subdirectories, enabling compatibility with the new built-in test platform
Fixed 4
  • Method trace capture in microbenchmark is no longer sometimes overcautiously skipped to avoid ANRs
  • Baseline profile capture now works for processes not using a :<suffix> naming pattern
  • Virtual file flushing no longer results in the error 'Unable to flush profiles for <packagename>'
  • Synchronization is fixed in method traces embedded in system trace
View originalRead the notes
How 1.6.0-alpha01 went

1.5.0-beta01

Added 1
  • PerfettoCapture and PerfettoTraceRule can now capture in-process traces and merge them for a target package.
View originalRead the notes
How 1.5.0-beta01 went

1.5.0-alpha07

Added 1
  • Added clearer error logging when the Perfetto kill timeout issue occurs.
Changed 5
  • Simplified Perfetto trace capture on device.
  • Moved the experimental TraceProcessor.runServer extension APIs from androidx.benchmark:benchmark-macro to androidx.benchmark:benchmark-common, and to the androidx.benchmark package, enabling their use in microbenchmarks in the future.
  • Updated the TraceProcessor implementation and unbundled Perfetto trace capture to use Perfetto v56.0.
  • Set androidx.benchmark.requireAot and androidx.benchmark.requireAot to true by default, ensuring compilation is performed ahead of running microbenchmarks and that measureRepeated is not used on the main thread.
  • Increased the Perfetto kill timeout from 5 to 30 seconds for benchmark-captured Perfetto sessions only.
View originalRead the notes
How 1.5.0-alpha07 went

1.5.0-alpha06

Fixed 1
  • Handle multi-user environments gracefully when moving files from the benchmark output directory to the additional test output directory.
View originalRead the notes
How 1.5.0-alpha06 went

1.5.0-alpha05

Added 1
  • Added the instrumentation argument androidx.benchmark.requireLockedClocks to enable a check for whether CPU clocks are locked on rooted devices
Changed 1
  • Updated ArtMetric to account for top-level packages, which is important when using AGP/R8 9.1+ or the -repackageclasses global option
Fixed 1
  • ArtMetric no longer fails to detect classloads in its artClassLoad measurements when top-level packages are used
View originalRead the notes
How 1.5.0-alpha05 went

1.5.0-alpha04

Added 1
  • Added JvmOverloads to PowerMetric.Energy and PowerMetric.Power
Changed 1
  • ArtMetric now accounts for top-level packages, which is important when using AGP/R8 9.1+ or the -repackageclasses global option
Fixed 1
  • ArtMetric no longer fails to detect classloads in its artClassLoad measurements when top-level packages are used
View originalRead the notes
How 1.5.0-alpha04 went

1.5.0-alpha02

Added 1
  • Partial support for baseline profile generation for Kotlin multi-platform modules
Changed 1
  • Baseline profile dependencies for Kotlin multi-platform modules should be defined using the baselineProfile extension instead of the baselineProfile Gradle configuration in the dependencies block, which does not work for KMP modules
View originalRead the notes
How 1.5.0-alpha02 went

1.5.0-alpha01

Added 3
  • Macrobenchmark MacrobenchmarkScope now extends UiAutomatorTestScope, allowing use of modern UiAutomator APIs such as onElement { ... }.click()
  • Trace config extended to include core size (e.g. little/big) in benchmark captured system/perfetto traces
  • Convenience constructors for PerfettoTraceRule now have @JvmOverloads
Changed 3
  • Macrobenchmark 1.5 uses UiAutomator 2.4 to simplify interacting with the measured application
  • In UiAutomator, startActivity now waits for a new window
  • BlackHole APIs in androidx.benchmark are stabilized
Fixed 1
  • Baseline Profile Gradle Plugin no longer requires newDsl=false in AGP 9.0
View originalRead the notes
How 1.5.0-alpha01 went

1.4.1

Fixed 1
  • Fixed perfettoSdkTracing=true (e.g. when tracing Compose in a microbenchmark) killing the target process if it was already running and a StartupMode was not specified.
View originalRead the notes
How 1.4.1 went

1.4.0

Changed 1
  • Moved Gradle tasks lockClocks and unlockClocks to be on benchmark projects instead of at the top level to respect Gradle project isolation
View originalRead the notes
How 1.4.0 went

1.4.0-rc01

Added 1
  • Added workaround for runtime images causing CompilationMode.None() to not measure worst case performance after first iteration
Changed 1
  • The workaround requires a 5 second delay to intentionally corrupt the runtime image at the beginning of each macrobenchmark suite
View originalRead the notes
How 1.4.0-rc01 went

1.4.0-beta02

Added 1
  • Added a BaselineProfileConfig.Builder to make it easier to call BaselineProfileRule.collectWithResults() for Java developers.
View originalRead the notes
How 1.4.0-beta02 went

1.4.0-beta01

Added 2
  • Added PerfettoTraceRule constructor variant which accepts a PerfettoConfig
  • Added proxy exception handler for TraceProcessorHttpServer
Changed 2
  • Updated TraceProcessor startup insight link format to use the correct plugin and a clearer delimiter, where ':' is used instead of '%3A' and both are supported
  • Always use force-stop to kill processes, even when rooted and killing system apps
Fixed 1
  • Fixed exceptions of the form 'Expected no stdout/stderr from killall ... No such process' when killing processes
View originalRead the notes
How 1.4.0-beta01 went

1.4.0-alpha11

Changed 4
  • Changed TraceProcessor's argument timeout from Duration to timeoutMs long for Java caller usability.
  • Marked TraceProcessor constructor as internal; callers should use TraceProcessor.startServer or TraceProcessor.runServer.
  • When killing the application with MacrobenchmarkScope.killProcess, the kill command results are now validated to prevent silent failure and timeout errors.
  • This library now targets Kotlin 2.0 language level and requires KGP 2.0.0 or newer.
View originalRead the notes
How 1.4.0-alpha11 went

1.3.4

Fixed 1
  • Fixed Gradle Project Isolation incompatibilities in the Benchmark Baseline Gradle Plugin.
View originalRead the notes
How 1.3.4 went

1.4.0-alpha10

Changed 2
  • Increased default timeout for TraceProcessor server load and querying to 120 seconds (from 60 and 30 seconds previously)
  • Made the TraceProcessor server load and query timeouts configurable with a single timeout parameter
Fixed 1
  • Fixed several issues that occurred when benchmarking or capturing profiles of an app without profileinstaller, including its included BroadcastReceiver, on rooted devices
View originalRead the notes
How 1.4.0-alpha10 went

1.4.0-alpha09

Added 2
  • Added TraceProcessor and Session API with closable Handles, for easier usage with custom lifecycles
  • Added experimental androidx.benchmark.killExistingPerfettoRecordings instrumentation argument, which can be set to false to allow pre existing perfetto trace capture to continue; by default pre existing perfetto trace captures on device are killed to prevent interference
Changed 4
  • The extension functions to TraceProcessor.runServer {} are now marked experimental, as they are likely to move and be made non-experimental in the future
  • Filter default tracing config to reduce risk of data loss in traces on newer API levels
  • The JSON field context.osCodenameAbbreviated will now be REL for released OS versions at and above API 35, as non-numeric code names are no longer supported by the underlying platform
  • No longer assume Choreographer#doFrame is the top of the stack frame on the main thread for FrameTimingQuery
Fixed 2
  • Fixed Benchmark and Baseline Profile capture not working with API 36 due to a change in pgrep toybox that now requires -a to print the full command line
  • Fixed crash in FrameTimingMetric when resynced frames occur
View originalRead the notes
How 1.4.0-alpha09 went

1.4.0-alpha08

Changed 5
  • Moved TraceProcessor.runSession() extension APIs to be experimental, as they are likely to move to be concrete constructors eventually on Android
  • Most of the implementation of Startup Insights is now public and experimental, and has moved to the TraceProcessor artifact
  • Exposed the MicrobenchmarkScope superclass so that runWithMeasurementDisabled can be overridden
  • Benchmark libraries have moved to Kotlin 2.0
  • Reduced the number of Microbenchmark internal functions called during profiling to make method traces clearer
Fixed 2
  • Benchmark now logs a message instead of crashing with 'Failed to stop ProcessPid(processName=perfetto)' when a background Perfetto process cannot be stopped before running the benchmark
  • Fixed IllegalStateExceptions with the 'Expected pm dump-profiles stdout' label caused by an overly strict output format check
Removed 1
  • Removed the androidx.benchmark.startupProfiles.enable instrumentation argument, as includeInStartupProfile in BaselineProfileRule.collect() now controls this
Deprecated 1
  • BenchmarkRule.runWithTimingDisabled {} is deprecated in favor of BenchmarkRule.runWithMeasurementDisabled {}, which more clearly describes the behavior of pausing all metrics
View originalRead the notes
How 1.4.0-alpha08 went

1.4.0-alpha07

Added 4
  • BaselineProfileRule now introduces a collectWithResults(...) API which includes a list of paths to the computed profiles
  • Added androidx.benchmark.measureRepeatedOnMainThread.throwOnDeadline instrumentation argument, which can be set to false to disable the throw on deadline behavior of measureRepeatedOnMainThread for local testing
  • Added @JvmOverloads to MicrobenchmarkConfig constructor
  • Added runWithMeasurementDisabled to BenchmarkRule to clarify behavior, where all measurement is paused
Changed 5
  • Refactored BenchmarkRule to be built on top of coroutines and support better yield() behavior
  • Moved PerfettoTraceProcessor to TraceProcessor in a new androidx.benchmark:benchmark-traceprocessor artifact, with most of its API made non-experimental
  • Custom TraceMetric implementations or code reading from traces must update to the new TraceProcessor import
  • Throw a clearer error message when MacrobenchmarkScope.startActivityAndWait fails to launch the target process, instead of the more ambiguous 'Unable to confirm activity launch completion' message
  • Clarified ArtMetric and CaptureInfo parameter docs
Fixed 1
  • Fixed several syntax errors in Kotlin samples and syntax highlighting in several Java and build.gradle samples
Removed 1
  • Removed several experimental BenchmarkState APIs as part of the BenchmarkRule coroutines refactor, with replacements to follow as needed
Deprecated 1
  • runWithTimingDisabled will be deprecated in the future
View originalRead the notes
How 1.4.0-alpha07 went

1.4.0-alpha06

Changed 2
  • The library now uses JSpecify nullness annotations, which are type-use; Kotlin developers should compile with -Xjspecify-annotations=strict to enforce correct usage
  • On Android Multiuser, commands are executed as root only on rooted devices
Fixed 1
  • ArtMetric now reports class load instead of class init, and the docs were improved to clarify runtime behavior
Removed 1
  • Removed usage of @Language("sql") in PerfettoTraceProcessor.Session.query() because Studio highlighting and parsing is broken
View originalRead the notes
How 1.4.0-alpha06 went

1.4.0-alpha05

Fixed 1
  • On API 34 and higher, CompilationMode.None() no longer produces inconsistent performance that fails to represent initial, worst-case performance, by working around a platform change that lets ART's compilation state verify partially compile apps (affecting only class loading) shortly after first launch
View originalRead the notes
How 1.4.0-alpha05 went

1.4.0-alpha04

Added 1
  • Baseline Profile generation and benchmarking are enabled on apps installed to a secondary user, for example any app on headless Android Auto devices (experimental).
Changed 3
  • isProfileable is now always overridden in benchmark builds.
  • isDebuggable is now always overridden in both benchmark and nonMinified (baseline profile capture) builds.
  • CpuEventCounter metrics now throw when invalid measurements are observed, such as instructions/cpucycles being 0.
Fixed 2
  • Compilation detection is fixed on some physical devices prior to API 28, affecting json context.compilationMode.
  • androidx.benchmark.requireAot=true no longer incorrectly throws on affected devices prior to API 28.
View originalRead the notes
How 1.4.0-alpha04 went

1.3.3

Fixed 1
  • CollectBaselineProfileTask now works when the AVD device name contains spaces
View originalRead the notes
How 1.3.3 went

1.4.0-alpha03

Added 2
  • Macrobenchmark adds ArtMetric, which can be used to inspect profile coverage or general Android RunTime performance, capturing number and total duration of JIT, class init (where available), and class verification
  • Benchmark JSON output includes coefficientOfVariation to show stability within a given benchmark run
Changed 2
  • CaptureInfo now includes an optional ART mainline version with a default value
  • The library uses JSpecify nullness annotations, which are type-use, and Kotlin developers should compile with -Xjspecify-annotations=strict to enforce correct usage
Fixed 3
  • CollectBaselineProfileTask now works when the AVD device name contains spaces
  • Speculative fix for StartupMode.COLD errors reporting that the package must not be running prior to cold start, as MacrobenchmarkScope.killProcess() now waits to verify that the app's processes have all stopped running
  • UNLOCKED_ error no longer shows up on some rooted emulators
View originalRead the notes
How 1.4.0-alpha03 went

1.3.2

Fixed 1
  • Fixed Firebase Test Lab (FTL) being unable to pull Baseline Profile or Macrobenchmark result files from the Baseline Profile Gradle Plugin
View originalRead the notes
How 1.3.2 went

1.4.0-alpha02

Added 1
  • Added instrumentation argument androidx.benchmark.saveProfileWaitMillis to control the profile dump wait duration
Changed 2
  • Moved Gradle tasks lockClocks and unlockClocks to be on benchmark projects instead of available at the top level, as top-level registration breaks project isolation
  • BaselineProfileRule now collects profiles for multi-process apps by signaling each running process at the end of the block to dump profiles
Fixed 2
  • A profile-based compilation now fails if it never successfully finds a process to broadcast to, since profile data is not expected in that case
  • Firebase Test Lab (FTL) is now able to pull Baseline Profile and Macrobenchmark result files from the Baseline Profile Gradle Plugin
View originalRead the notes
How 1.4.0-alpha02 went

1.3.1

Added 1
  • Added gradle property androidx.baselineprofile.suppressWarnings to suppress all baseline profile warnings
Fixed 1
  • Fixed Baseline Profile Gradle Plugin to use pre-existing nonMinified and benchmark build types if created by the app instead of creating wrappers
View originalRead the notes
How 1.3.1 went

1.4.0-alpha01

Added 4
  • Initial version of app startup insights can be enabled in Macrobenchmark via StartupInsightsConfig in ExperimentalConfig, which analyzes the trace for common startup problems and prints them after metrics in Studio test output
  • Added gradle property androidx.baselineprofile.suppressWarnings to suppress all baseline profile warnings
  • Microbench metrics are now displayed in Perfetto traces as counters
  • Added benchmark argument skipBenchmarksOnEmulator to skip tests when running on an emulator
Changed 5
  • Existing experimental PerfettoConfig argument to MacrobenchmarkRule.measureRepeated() moved to the new ExperimentalConfig object
  • Increased lockClocks.sh retry count
  • Perf event enable logic now runs on API 23 and above
  • Emulator check now considers the sdk_ prefix
  • resumeTiming and runWithTimingDisabled now respect metric priority order, significantly reducing the impact of lower priority metric pause/resume on higher priority metric results
Fixed 4
  • nonMinified and benchmark build types are no longer recreated when they already exist
  • Non-terminating slices are ignored from TraceSectionMetric results
  • Non-running packages are treated as cleared in FrameTimingGfxInfoMetric
  • androidx.benchmark.cpuEventCounter no longer produces corrupt values for non-Instruction events
View originalRead the notes
How 1.4.0-alpha01 went

1.3.0

Added 11
  • Method tracing is on by default in microbenchmarks when running on most devices, and runs as a separate phase after measurements so accurate measurements and method traces can both be output from a single run
  • Added measureRepeatedOnMainThread for UI thread benchmarks to avoid ANRs when running for many seconds
  • Embedded proguard rules to improve microbenchmarking with minification enabled
  • Minification/R8 in a library module can be enabled via android.buildTypes.release.androidTest.enableMinification with AGP 8.3
  • Experimental BlackHole.consume() API to prevent dead code elimination
  • Experimental cpu event counter feature exposing perf_event_open metrics, enabled via androidx.benchmark.cpuEventCounter.enable and configured via androidx.benchmark.cpuEventCounter.events
Changed 7
  • On some Android OS and ART versions method tracing is off by default in microbenchmarks because it affects later measurement phases, and a warning is printed to Studio output
  • Method traces are skipped when expected to overrun the ANR avoidance deadline, controllable via androidx.benchmark.profiling.skipWhenDurationRisksAnr
  • Method tracing for macrobenchmarks overhauled so traces are scoped to the duration of the measureBlock and can capture multiple sessions if the process starts multiple times
  • Drop Shader broadcast failure message now includes debugging suggestions
  • Background dexopt jobs are cancelled before running a Macrobenchmark to reduce interference
  • Macrobenchmark now waits 1 second for the target application to flush an ART profile, up from 500 ms
  • TraceSectionMetric default mode is now Sum instead of First
Fixed 3
  • Previously method tracing in macrobenchmarks only worked for StartupMode.COLD and captured nothing for measureBlocks that did not restart the target process
  • Method traces in macrobenchmark are flushed fully so they are valid and captured completely, even on slower devices
  • ART profile is correctly dumped during individual warmUp iterations when the process is killed, making CompilationMode.Partial(warmup=N) measurements more accurate
View originalRead the notes
How 1.3.0 went

1.3.0-rc01

Added 1
  • Added an AGP version check so the target app package name is sent to the instrumentation app as an instrumentation argument when using AGP 8.4.0 or later
Changed 1
  • Removed manual outlining of access to new platform APIs, since this now happens automatically via API modeling when using R8 with AGP 7.3 or later, and for all builds when using AGP 8.1 or later
Fixed 3
  • Fixed androidx.benchmark.cpuEventCounter producing corrupt values for non-Instruction events
  • Fixed resumeTiming and runWithTimingDisabled to respect metric priority order, significantly reducing the impact of lower priority metric pause/resume on higher priority metric results
  • Reduced chance of stack sampling causing measureRepeatedOnMainThread to hit the main thread hard timeout by moving stack sampling conversion off the main thread
View originalRead the notes
How 1.3.0-rc01 went

1.3.0-beta02

Changed 1
  • Gracefully handle EXITCODE 2 when starting Perfetto by logging a warning and proceeding
View originalRead the notes
How 1.3.0-beta02 went

1.3.0-beta01

Added 6
  • Added experimental BlackHole.consume() API to prevent dead code elimination in microbenchmarks
  • Added compilation mode to benchmark context
  • Added context.artMainlineVersion to benchmark context in JSON output, an integer version of the ART mainline module (-1 if not present on device)
  • Added context.build.id to benchmark context in JSON output, equal to android.os.Build.ID
  • Added context.build.version.codename to benchmark context in JSON output, equal to android.os.Build.VERSION.CODENAME
  • Added context.build.version.abbreviatedCodename to benchmark context in JSON output, corresponding to the first letter of the pre-release codename even on release builds
Changed 5
  • Renamed MethodTracing.affectsMeasurementOnThisDevice to AFFECTS_MEASUREMENT_ON_THIS_DEVICE for consistency
  • Bumped max AGP version recommended to 9.0.0-alpha01
  • AIDL tracing is now enabled by default (requires API 28)
  • Changed macro-to-common dependency to api(), making PerfettoTrace and PerfettoConfig easier to use
  • Increased default start timeout for perfetto trace processor
Fixed 4
  • Microbenchmark now correctly throws to prevent method tracing from interfering with measurements when method tracing is forced on and a measurement is attempted after a method trace, on affected devices running API 26-30 or certain affected ART mainline module versions, detectable via ProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice
  • StackSampling now respects androidx.benchmark.profiling.sampleDurationSeconds
  • mergeArtProfile and mergeStartupProfile tasks now always wait for baseline profile generation
  • Variant enable state is now considered when deciding whether a variant should be enabled
View originalRead the notes
How 1.3.0-beta01 went

1.3.0-alpha05

Changed 4
  • Throw a clearer exception when a macrobench metric returns zero values for all iterations
  • Add additional workaround rules to microbench proguard rules, including support for listener rules and other observed warnings and errors
  • Run method tracing as a separate phase during a Macrobenchmark so that it no longer affects measurements
  • Add extra debugging suggestions to the shader broadcast failure message
View originalRead the notes
How 1.3.0-alpha05 went

1.3.0-alpha04

Added 5
  • Experimental MacrobenchmarkRule#measureRepeated variant that takes a custom PerfettoConfig for fully customized Perfetto trace recording
  • PowerMetric.deviceBatteryHasMinimumCharge() to enable changing or skipping benchmarks based on device battery charge
  • PowerMetric.deviceSupportsPowerEnergy() to enable changing or skipping benchmarks based on device power measurement capability
  • Comparison with previous baseline profile
  • DSL to disable warnings
Changed 3
  • Renamed PowerMetric.deviceSupportsPowerEnergy to PowerMetric.deviceSupportsHighPrecisionTracking for clarity
  • Benchmark variants being disabled now logs an info message instead of an exception
  • Method trace capture for Macrobenchmark is scoped to the duration of measureBlock(), making it simpler to capture method traces; previously it started at target process launch and only supported cold starts
Fixed 1
  • Avoid crashing when the perfetto trace processor is slow to start
View originalRead the notes
How 1.3.0-alpha04 went

1.2.4

Changed 1
  • Uses am force-stop to kill apps when they are not system apps such as System UI or Launcher
Fixed 3
  • Fixes baseline profile srcset not being set up in benchmark variants
  • Fixes automaticGenerationDuringBuild in libraries causing a circular dependency
  • Fixes StartupMode.COLD benchmarks crashing with "Package $package must not be running prior to cold start!" caused by process kill not fully succeeding
View originalRead the notes
How 1.2.4 went

1.3.0-alpha03

Added 9
  • Public API PerfettoTraceProcessor.Session.queryMetrics with JSON, textproto, and proto binary (undecoded) variants for querying metrics built into TraceProcessor
  • profilerOutput added to JSON output for easier tooling around profiling traces such as perfetto and method traces
  • power tag added to the benchmark Perfetto config, capturing for example wakelock tracepoints
  • Instrumentation argument androidx.benchmark.profiling.skipWhenDurationRisksAnr, which can be set to false to avoid skipping method traces when expected duration may cause an ANR
  • Experimental instrumentation argument androidx.benchmark.profiling.perfCompare.enable to run comparison timing between measurement and profiling phases
  • TraceSectionMetric.Mode.Average and TraceSectionMetric.Mode.Count added, and arguments reordered so mode appears earlier in the argument list
Changed 7
  • TraceSectionMetric.Mode changed to a sealed class to enable future expansion without breaking exhaustive when statements
  • Metric.getResult renamed to getMeasurements to match its return type
  • Blocking start enabled on Perfetto trace record to reduce risk of missing data at the beginning of the trace, supported only on API 33+
  • Comma thousands separators are now always used in Studio output, ignoring device locale
  • Log.w and exception labels added to all startup detection failures to make errors more understandable without changing current behavior
  • Background dexopt jobs are canceled before running a Macrobenchmark to reduce interference
  • Documentation clarifies that frameOverrunMs is the preferred metric for tracking when available, and why
Fixed 3
  • Benchmarks now use generated baseline profiles when automaticGenerationDuringBuild is off
  • BaselineProfile Gradle plugin property overrides now enable baseline profile generation and benchmarking when customizing a nonMinified or benchmark build type
  • Method traces in Macrobenchmark are flushed fully so they are captured and valid, even on slower devices
View originalRead the notes
How 1.3.0-alpha03 went

1.3.0-alpha02

Added 2
  • Experimental R8 support in microbench via embedded proguard rules, requiring AGP 8.3 for minification of library module tests
  • Option to enable R8 minification and optimization for benchmark modules via buildTypes.release.androidTest.enableMinification = true in build.gradle
Fixed 1
  • Method tracing warning is now printed on a separate line from microbench output
View originalRead the notes
How 1.3.0-alpha02 went

1.3.0-alpha01

Added 8
  • Added BenchmarkRule.measureRepeatedOnMainThread so main thread benchmarks, such as those touching Views or Compose UIs, can avoid triggering ANRs during large suites in CI
  • Added FrameTimingGfxInfoMetric, an experimental alternate implementation of FrameTimingMetric that takes measurements directly from the platform rather than extracting them from the Perfetto trace
  • Added the ability to dump an ART profile during individual warmUp iterations
  • Added Mode.Min and Mode.Max to TraceSectionMetric
  • Added a label argument to TraceSectionMetric to override the section name as the metric label
  • Added the mode name to TraceSectionMetric output to clarify metric meaning
  • Added instrumentation argument androidx.benchmark.dropShaders.enable to skip all shader dropping, including that done in StartupMode.Cold launches, when benchmarking apps that do not yet use profileinstaller 1.3
  • Added instrumentation argument androidx.benchmark.dropShaders.throwOnFailure to tolerate failures when dropping shaders, such as when benchmarking apps without profileinstaller 1.3
Changed 4
  • Renamed MicrobenchmarkConfig boolean parameters to remove the unnecessary word 'should'
  • Changed TraceSectionMetric default mode to sum, since most usage is for repeated events; CI usage may see discontinuities or parsing breakage as a result
  • Improved the error message in the baseline profile Gradle plugin when a specified managed device does not exist
  • Skip method tracing on the UI thread when it is expected to take longer than a few seconds, and clean up method traces when throwing
Fixed 3
  • Fixed inclusion of library baseline profiles in AAR prior to AGP 8.3.0-alpha15
  • Fixed baseline and startup profile output URL printed at the end of the generation task
  • Adjusted data source timeouts in an attempt to fix java.lang.IllegalStateException: Failed to stop perfetto process
View originalRead the notes
How 1.3.0-alpha01 went

1.2.3

Fixed 1
  • Fixed including library baseline profiles in AAR prior to AGP 8.3.0-alpha15.
Removed 1
  • Removed exception from Baseline Profile Gradle Plugin when AGP version is 8.3.0 or higher.
View originalRead the notes
How 1.2.3 went

1.2.2

Changed 1
  • Execution logs now show the baseline profile output file path as a local file URI
View originalRead the notes
How 1.2.2 went

1.2.1

Added 1
  • Added properties to support Android Studio test run integration
Changed 1
  • Improved the error message shown when a user disables test variants
View originalRead the notes
How 1.2.1 went

1.2.0

Added 13
  • Baseline Profile Gradle Plugin automates capturing and including baseline profiles in the test and build workflow
  • Libraries generating baseline profiles can filter generated rules in code via the BaselineProfileRule.collect argument or in the Gradle plugin
  • Support for androidx.benchmark.dryRunMode.enable instrumentation argument in Macrobenchmark for quicker validation runs
  • Support for androidx.benchmark.profiling.mode set to StackSampling and MethodTracing
  • androidx.benchmark.enabledRules argument to allow runtime filtering of baseline profile versus macrobenchmark rule tests
  • androidx.benchmark.perfettoSdkTracing.enable argument to enable tracing with tracing-perfetto
Changed 8
  • BaselineProfileRule.collect is now stable, a streamlined and simplified version of the previous experimental BaselineProfileRule.collectBaselineProfile API
  • Macrobenchmark now fully resets compilation state for each compile, which requires reinstalling the APK prior to Android 14
  • Macrobenchmark now requires ProfileInstaller 1.3.0 or greater in the target app
  • Clearer errors when device OS image is not correctly configured for tracing or compilation
  • Battery level check skipped for devices without a battery
  • Improved file output with clearer errors for invalid output directories and safer defaults
  • StartupMode.COLD stability improved by consistently dropping the shader cache
  • Profiling moved to a separate phase after other metrics so one run can display both accurate timing and profiling results
Fixed 5
  • Baseline profile collection fixed on Android U and later
  • Crashes when installing or extracting profiles from an app installed from multiple APKs
  • FrameTimingMetric no longer ignores frames with inconsistent frame IDs
  • Parsing errors on traces larger than 64MB
  • Leanback fallback for startActivityAndWait
View originalRead the notes
How 1.2.0 went

1.2.0-rc02

Changed 1
  • Clarified tracing-perfetto loading error messages when injecting from the macrobenchmark module into the target application.
Fixed 1
  • Benchmark file output no longer breaks BaselineProfile Plugin file copying, since generated files were renamed so the Gradle plugin could not find them.
View originalRead the notes
How 1.2.0-rc02 went

1.2.0-rc01

Added 1
  • An exception with remedy instructions is thrown when Perfetto SDK tracing fails to initialize in a Benchmark
Fixed 1
  • OOM crash when converting ART method trace to Perfetto format is fixed
View originalRead the notes
How 1.2.0-rc01 went
View all

Discussion