Accurately measure your code's performance within Android Studio.
Latest Update Stable Release Release Candidate Beta Release Alpha Release
May 11, 2022 1.0.0 1.1.0-rc02 - -

Declaring dependencies

To add a dependency on Benchmark, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:


To use Macrobenchmark in your project, add the following dependencies to your build.gradle file for your app or module:


dependencies {
  androidTestImplementation "androidx.benchmark:benchmark-macro-junit4:1.1.0-rc02"


dependencies {



dependencies {
    androidTestImplementation "androidx.benchmark:benchmark-junit4:1.0.0"

android {
    defaultConfig {
        testInstrumentationRunner "androidx.benchmark.junit4.AndroidBenchmarkRunner"


dependencies {

android {
    defaultConfig {
        testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner"

Benchmark 库还提供了可与基准模块搭配使用的 Gradle 插件。此插件可设置模块的默认 build 配置,设置将基准输出复制到主机,并提供 ./gradlew lockClocks 任务

如需使用该插件,请在顶级 build.gradle 文件的“plugins”代码块中添加以下代码行:


plugins {
  id 'androidx.benchmark' version '1.0.0' apply false


plugins {
  id("androidx.benchmark") version "1.0.0" apply false

然后,将该插件应用到基准模块的 build.gradle 文件


plugins {
  id 'androidx.benchmark'


plugins {


Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.1.0

Version 1.1.0-rc02

May 11, 2022

androidx.benchmark:benchmark-*:1.1.0-rc02 is released. Version 1.1.0-rc02 contains these commits.

  • Note that this release includes a behavior change, as apps are now fully reinstalled in between each benchmark to ensure accurate measurements.

Bug Fixes/Behavior Changes

  • Fixed an issue where app compilation was not correctly reset between macrobenchmarks, and not reset at all on unrooted builds. This fixes many cases where running multiple tests would result in CompilationMode having little to no effect on measurements. To workaround this problem, the target app is now fully reinstalling each test method, which will clear application data between each macrobenchmark. (I31c74, b/230665435)

  • As this prevents apps from setting up state before tests, it is now possible to skip compilation / reinstallation to enable working around this. You can for example fully compile the target with a shell command cmd package compile -f -m speed <package>, and then bypass macrobenchmark's compilation step.

    E.g. in Your macrobenchmark's build.gradle:

    android {
        defaultConfig {
            testInstrumentationRunnerArgument 'androidx.benchmark.compilation.enabled, 'false'

    Or from the Gradle command line:

    ./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.compilation.enabled=false
  • Made it possible to share a module between macrobenchmarks and baseline profile generating tests by adding androidx.benchmark.enabledRules instrumentation argument. Pass in 'Macrobenchmark', or 'BaselineProfile' to just run one type of test, e.g. when generating BaselineProfiles on an emulator. (I756b7, b/230371561)

    E.g. in Your macrobenchmark's build.gradle:

    android {
        defaultConfig {
            testInstrumentationRunnerArgument 'androidx.benchmark.enabledRules', 'BaselineProfile'

    Or from the Gradle command line:

    ./gradlew macrobenchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile

Version 1.1.0-rc01

April 20, 2022

androidx.benchmark:benchmark-*:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.

Bug Fixes

  • Baseline profile output links in Android Studio now use a unique file name. This way the output always reflects the latest results of using a BaselineProfileRule. ( aosp/2057008, b/228203086 )

Version 1.1.0-beta06

April 6, 2022

androidx.benchmark:benchmark-*:1.1.0-beta06 is released. Version 1.1.0-beta06 contains these commits.

Bug Fixes

  • Fix trace recording crash on API 21/22 (If7fd6, b/227509388)
  • Overhaul activity launch completion detection to fix 'Unable to read any metrics' exception in startup macrobenchmarks. (Ia517c)
  • Fix startup metrics for Macrobenchmarks when CompilationMode.None() is used. Before this change, CompilationMode.Partial() would appear to be slower than Compilation.None(). (611ac9).

Version 1.1.0-beta05

March 23, 2022

androidx.benchmark:benchmark-*:1.1.0-beta05 is released. Version 1.1.0-beta05 contains these commits.

Bug Fixes

Version 1.1.0-beta04

February 23, 2022

androidx.benchmark:benchmark-*:1.1.0-beta04 is released. Version 1.1.0-beta04 contains these commits.

Bug Fixes

  • Fix missing metrics on Android 10, and NoSuchElementException caused by process names not being captured correctly in traces. (Ib4c17, b/218668335)

  • Use PowerManager for thermal throttling detection on Q (API 29) and higher. This significantly reduces frequency of false positives in thermal throttling detection (benchmark retry after 90 second cooldown), and speeds up benchmarks significantly on user builds. It also provides throttle detection even when clocks are locked (if they're locked too high for the device's physical environment). (I9c027, b/217497678, b/131755853)

  • Filter simpleperf sampled profiling to measureRepeated thread only to simplify inspection (Ic3e12, b/217501939)

  • Support metrics from named UI subprocesses in multi-process apps (Ice6c0, b/215988434)

  • Filter Baseline Profile rules to target Android 9 (SDK 28). aosp/1980331 b/216508418

  • Skip Profile Installation when using Compilation.None(). Additionally, report warnings when the app is using an older version of androidx.profileinstaller and Android Gradle Plugin. aosp/1977029

Version 1.1.0-beta03

February 9, 2022

androidx.benchmark:benchmark-*:1.1.0-beta03 is released. Version 1.1.0-beta03 contains these commits.

API Changes

  • Added AudioUnderrunMetric into macrobenchmark library under experimental flag to allow detection of audio underruns (Ib5972)
  • BaselineProfileRule no longer accepts a setup block as this functioned the same as the profileBlock. (Ic7dfe, b/215536447)

    For e.g.

    fun collectBaselineProfile() {
            packageName = PACKAGE_NAME,
            setupBlock = {
            profileBlock = {
                // ...
    fun collectBaselineProfile() {
            packageName = PACKAGE_NAME,
            profileBlock = {
                // ...

Bug Fixes

  • Fixed issue where microbench profiler traces would fail to be updated in subsequent runs when linked in Studio output (I5ae4d, b/214917025)
  • Prevent compilation shell commands on API 23 (Ice380)
  • Renamed FrameCpuTime -> FrameDurationCpu, FrameUiTime -> FrameDurationUi to clarify these are durations, not timestamps, and to match prefixes. (I0eba3, b/216337830)

Version 1.1.0-beta02

January 26, 2022

androidx.benchmark:benchmark-*:1.1.0-beta02 is released. Version 1.1.0-beta02 contains these commits.

Bug Fixes

  • Microbenchmark Stack Sampling / Method Tracing Profile results are now linked in Studio output, similar to other profiling outputs, and do not suppress the allocation metric. (Idcb65, b/214440748, b/214253245)
  • BaselineProfileRule now prints the adb pull command in logcat and Studio output for pulling generated BaselineProfile text file. (f08811)

Version 1.1.0-beta01

January 12, 2022

androidx.benchmark:benchmark-*:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.

Bug Fixes

  • Fixes profiler argument enable being ignored. (I37373, b/210619998)
  • Removed deprecated CompliationModes (I98186, b/213467659)
  • Switched baseline profile arg of CompilationMode.Partial to enum for clarity. (Id67ea)

Version 1.1.0-alpha13

December 15, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha13 is released. Version 1.1.0-alpha13 contains these commits.

API Changes

  • Add low-overhead System Tracing to microbench output on Android Q (API 29+). Note that this does not currently capture custom tracing (via android.os.Trace or androidx.tracing Jetpack APIs) to avoid affecting results. This tracing should be useful in diagnosing instability, especially from sources outside the benchmark. (I298be, b/205636583, b/145598917)
  • Clarify CompilationModes into three classes - Full, None, Partial. Previously they were inconsistently named after compilation arguments (which we now treat as implementation details) and features. This makes the tradeoffs, potential combinations, and behavior across platform versions more clear. (I3d7bf, b/207132597)
  • Setup and measure are now always in pairs, in order. You can now query the package name and iteration (though the iteration may be null in certain warmup scenarios). (Id3b68, b/208357448, b/208369635)

Bug Fixes

  • Fixed CompilationMode.Speed incorrectly treated as None (I01137)

Version 1.1.0-alpha12

November 17, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha12 is released. Version 1.1.0-alpha12 contains these commits.

New Features

  • Add experimental TraceSectionMetric for custom trace-based timing measurements. (I99db1, b/204572664)

Bug Fixes

  • Wake device each iteration, to ensure UI can be tested - requires lockscreen is disabled. (Ibfa28, b/180963442)
  • Fixes multiple crashes in StackSampling profiling mode on emulators and non-rooted devices (Icdbda, b/202719335)
  • Removed 0.5 second sleep at the end of each iteration - if you see missing metrics with this change, please file a bug. (Iff6aa)
  • Reduce chances of dropped data, and lower memory overhead from tracing (Id2544, b/199324831, b/204448861)
  • Reduce trace size by ~40% by switching to compact sched storage format. (Id5fb6, b/199324831)
  • Updated implementations of startup metrics to always end at end of renderthread. This will be more contistent across platform versions, and more closely map to in-app measurements. (Ic6b55)

Version 1.1.0-alpha11

November 3, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha11 is released. Version 1.1.0-alpha11 contains these commits.

API Changes

  • Macrobenchmark now has a minSdkVersion of 23. (If2655)
  • Adds a new experimental BaselineProfileRule which is capable of generating baseline profiles for app's critical user journey. Detailed documentation to follow. (Ibbefa, b/203692160)
  • Removes measureRepeated interface variant, which was added for java callers, as it caused ambiguity in completing/resolving the method. Java callers will again need to return Unit.Instance from measureRepeated. If this is an inconvenience, please file a bug, we can revisit this in a future version. (Ifb23e, b/204331495)

Version 1.1.0-alpha10

October 27, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha10 is released. Version 1.1.0-alpha10 contains these commits.

API Changes

  • Backport StartupTimingMetric to work back to API 23. This new implementation also better handles reportFullyDrawn() to wait until corresponding content has been rendered. (If3ac9, b/183129298)
  • Added JvmOverloads to multiple MacrobenchmarkScope methods for Java callers. (I644fe, b/184546459)
  • Provide alternative MacrobenchmarkRule.measureRepeated function that uses a Consumer<MacrobenchmarkScope> for idiomatic usage in Java language. (If74ab, b/184546459)

Bug Fixes

  • Fix for traces not starting early enough, and missing metric data. This is expected to fix "Unable to read any metrics during benchmark" exceptions that were caused by the library itself. (I6dfcb, b/193827052, b/200302931)
  • FrameNegativeSlack has been renamed to FrameOverrun to clarify its meaning - how much the frame went over its time budget. (I6c2aa, b/203008701)

Version 1.1.0-alpha09

October 13, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha09 is released. Version 1.1.0-alpha09 contains these commits.

Bug Fixes

Version 1.1.0-alpha08

September 29, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha08 is released. Version 1.1.0-alpha08 contains these commits.

API Changes

  • Enable scrolling macrobenchmarks to run back to API 23 (If39c2, b/183129298)
  • Add new type of sampled metric to UI and JSON output, focused on percentiles of multiple samples per iteration. (I56247, b/199940612)
  • Switch to floating point metrics throughout the benchmark libraries (truncated in the Studio UI). (I69249, b/197008210)

Version 1.1.0-alpha07

September 1, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha07 is released. Version 1.1.0-alpha07 contains these commits.

API Changes

  • Raised min API to 21 to reflect the intended lowest API level to be supported in the future. Current min API supported continues to be conveyed via RequiredApi(), and is currently 29 (I440d6, b/183129298)

Bug Fixes

  • Fixes ProfileInstaller to make it easier for apps using baseline profiles to run MacroBenchmarks using CompilationMode.BaselineProfile. (I42657, b/196074999) NOTE: requires also updating to androidx.profileinstaller:profileinstaller:1.1.0-alpha04 or greater.
  • StartupMode.COLD + CompilationMode.None benchmarks are now more stable. (I770cd, b/196074999)

Version 1.1.0-alpha06

August 18, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha06 is released. Version 1.1.0-alpha06 contains these commits.

API Changes

  • Added androidx.benchmark.iterations instrumentation argument to allow manual overriding of iteration count when testing/profiling locally. (6188be, b/194137879)

Bug Fixes

  • Switched to Simpleperf as default sampling profiler on API 29+. (Ic4b34, b/158303822)

Known Issues

  • CompilationMode.BaselineProfile is a work in progress. Avoid using it to determine how good a profile is for now.

Version 1.1.0-alpha05

August 4, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha05 is released. Version 1.1.0-alpha05 contains these commits.

1.1.0-alpha04 was cancelled before release due to a sporatic crash. b/193827052

API Changes

  • Switched startActivityAndWait to invoke launch via am start, which reduces the time of each measurement iteration by approximately 5 seconds, at the cost of no longer supporting intent parcelables. (I5a6f5, b/192009149

Bug Fixes

  • Reduce aggressiveness of thermal throttle detection, and recompute baseline if throttles are detected frequently. (I7327b)
  • Fixes FrameTimingMetric to work on Android S beta (Ib60cc, b/193260119)
  • Use an EmptyActivity to bring the target app out of a force-stopped state to better support CompilationMode.BaselineProfile. (Id7cac, b/192084204)
  • Changed trace file extension to .perfetto-trace to match platform standard. (I4c236, b/174663039)
  • StartupTimingMetric now outputs the "fullyDrawnMs" metric to measure time until your application has completed rendering. To define this metric for your app, call Activity.reportFullyDrawn when your initial content is ready, such as when your initial list items are loaded from DB or network. (reportFullyDrawn method available without build version checks on ComponentActivity). Note that your test must run long enough to capture the metric (startActivityAndWait doesn't wait for reportFullyDrawn). (If1141, b/179176560)
  • Reduce cost of appending Ui metadata to traces by 50+ ms (Ic8390, b/193923003)
  • Drastically increased polling frequency when stopping tracing, which can reduce e.g. startup benchmark runtime by 30+% (Idfbc1, b/193723768)

Version 1.1.0-alpha03

June 16, 2021

androidx.benchmark:benchmark-*:1.1.0-alpha03 is released. Version 1.1.0-alpha03 contains these commits.

New Features

Bug Fixes

  • The sample Gradle code for suppressing benchmark errors has been updated to use a non-deprecated API with a syntax that also supports .gradle.kts users.


    testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR,LOW-BATTERY"

Version 1.1.0-alpha02

May 18, 2021

Benchmark version 1.1.0-alpha02 brings a big component to benchmarking - Macrobenchmark. In addition to benchmark allowing you to measure CPU loops, macrobenchmark allows you to measure whole-app interactions like startup and scrolling, and capture traces. For more information see the library documentation.

androidx.benchmark:benchmark-*:1.1.0-alpha02 is released. Version 1.1.0-alpha02 contains these commits.

New Features

Macrobenchmark artifacts added (androidx.benchmark:benchmark-macro-junit4 and androidx.benchmark:benchmark-macro)

  • Capture startup, scrolling/animation performance metrics from your app, locally or in CI
  • Capture and inspect traces from within Android Studio

Bug Fixes

  • Workaround shell permissions issue with output directory on Android 12 (Note - may require updating Android Gradle Plugin to 7.0.0 canary and Android Studio to Arctic Fox (2020.3.1), to continue capturing output files on affected devices). (Icb039)
  • Support configuration caching in BenchmarkPlugin (6be1c1, b/159804788)
  • Simplified file output - on by default, in a directory that doesn't require requestLegacyExternalStorage=true (8b5a4d, b/172376362)
  • Fixes library printing logcat warnings about not finding JIT thread on platform versions where it is not present. (I9cc63, b/161847393)
  • Fix for reading device max frequency. (I55c7a)

Version 1.1.0-alpha01

June 10, 2020

androidx.benchmark:benchmark-common:1.1.0-alpha01, androidx.benchmark:benchmark-gradle-plugin:1.1.0-alpha01, and androidx.benchmark:benchmark-junit4:1.1.0-alpha01 are released. Version 1.1.0-alpha01 contains these commits.

New Features of 1.1

  • Allocation Metric - Benchmarks now run an additional phase after warmup and timing, capturing allocation counts. Allocations can cause performance problems on older versions of the platform (140ns in O became 8ns in M - measured on Nexus5X, with locked clocks). This metric is displayed in Android Studio console output, as well as in the
  • Profiling support - You can now capture profiling data for a benchmark run, to inspect why your code may be running slowly. Benchmark supports capturing either method tracing, or method sampling from ART. These files can be inspected with the Profiler inside Android Studio using File > Open.
  • The Benchmark Gradle plugin now provides defaults for simpler setup:
    • testBuildType is set to release by default, to avoid using dependencies with code coverage built-in. The release buildType is also configured as the default buildType, which allows Android Studio to automatically select the correct build variant when opening a project for the first time. (b/138808399)
    • signingConfig.debug is used as the default signing config (b/153583269)

** Bug Fixes **

  • Significantly reduced the warmup transition overhead, where the first measurement for each benchmark was artificially higher than others. This issue was more pronounced in very small benchmarks (1 microsecond or less). (b/142058671)
  • Fixed InstrumentationResultParser error printed for each benchmark when running from command line. (I64988, b/154248456)

Known Issues

  • Command line, gradle invocations of Benchmark do not print out results directly. You can work around this by either running through Studio, or parsing the JSON output file for results.
  • Benchmark reporting fails to pull the report from devices that have an app installed with an applicationId ending with either “android” or “download” (case insensitive). Users hitting this issue should upgrade the Android Gradle Plugin to 4.2-alpha01 or later.

Version 1.0.0

Benchmark Version 1.0.0

November 20, 2019

androidx.benchmark:benchmark-common:1.0.0, androidx.benchmark:benchmark-gradle-plugin:1.0.0, and androidx.benchmark:benchmark-junit4:1.0.0 are released with no changes from 1.0.0-rc01. Version 1.0.0 contains these commits.

Major features of 1.0.0

The Benchmark library allows you to write performance benchmarks of app code and get results quickly.

It prevents build and runtime configuration issues and stabilizes device performance to ensure that measurements are accurate and consistent. Run the benchmarks directly in Android Studio, or in Continuous Integration to observe code performance over time, and to prevent regressions.

Major features include:

  • Clock stabilization
  • Automatic thread prioritization
  • Support for UI performance testing, such as in the RecyclerView Sample
  • JIT-aware warmup and looping
  • JSON benchmark output for post-processing

Version 1.0.0-rc01

October 23, 2019

androidx.benchmark:benchmark-common:1.0.0-rc01, androidx.benchmark:benchmark-gradle-plugin:1.0.0-rc01, and androidx.benchmark:benchmark-junit4:1.0.0-rc01 are released. Version 1.0.0-rc01 contains these commits.

New features

  • Added systrace tracing to benchmarks

Bug fixes

  • Fixed metric instability issue where JIT wouldn't finish before warm up due to deprioritization (b/140773023)
  • Unified JSON output directory across Android Gradle Plugin 3.5 and 3.6

Version 1.0.0-beta01

October 9, 2019

androidx.benchmark:benchmark-common:1.0.0-beta01, androidx.benchmark:benchmark-gradle-plugin:1.0.0-beta01, and androidx.benchmark:benchmark-junit4:1.0.0-beta01 are released. Version 1.0.0-beta01 contains these commits.

New features

  • Run garbage collection before each warmup to reduce memory pressure from one benchmark to leak to the next (b/140895105)

Bug fixes

  • Added androidx.annotation:android-experimental-lint dependency, so that Java code will correctly produce lint errors when experimental API is not used, similar to what is provided by the Kotlin experimental annotation for Kotlin callers.
  • Now correctly detects usage of additionalTestOutputDir instrumentation argument for output in Android Gradle Plugin 3.6, to know when AGP will handle data copy.
  • Fix undetected clock frequency in JSON to correctly print -1 (b/141945670).

Version 1.0.0-alpha06

September 18, 2019

androidx.benchmark:benchmark-common:1.0.0-alpha06, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha06, and androidx.benchmark:benchmark-junit4:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.

New features

  • Added a check for incorrectly using the old package for the test runner, which now provides a more-helpful error message

API changes

  • The experimental annotation ExperimentalAnnotationReport is now correctly public. Usage of the experimental BenchmarkState#report API now requires this annotation

Version 1.0.0-alpha05

September 5, 2019

androidx.benchmark:benchmark-common:1.0.0-alpha05, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha05, and androidx.benchmark:benchmark-junit4:1.0.0-alpha05 are released. The commits included in this version can be found here.

API changes

  • BenchmarkState.reportData API is now marked experimental

Bug fixes

  • Fix for the clock-locking script, which would fail on devices that were either missing the cut or expr shell utilities.
  • Fixed an issue with ./gradlew lockClocks task that would hang on devices that were rooted with an older version of the su utility, which did not support the -c flag.

Version 1.0.0-alpha04

August 7, 2019

androidx.benchmark:benchmark-common:1.0.0-alpha04, androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha04, and androidx.benchmark:benchmark-junit4:1.0.0-alpha04 are released. The commits included in this version can be found here.

New documentation has also been added for how to use the Benchmark library without Gradle, both for usage with different build systems (such as Bazel or Buck), and when running in CI. For more information, see Build benchmarks without Gradle and Run benchmarks in Continuous Integration.

New features

  • Gradle plugin
    • Now automatically disables test coverage, and sets the AndroidBenchmarkRunner by default (b/138374050)
    • Added support for new AGP-based data copy, when running benchmarks and when using AGP 3.6+
  • JSON format additions
    • Output total benchmark test run time (b/133147694)
    • @Parameterized benchmarks that use a name string (for example @Parameters(name = "size={0},depth={1}")) now output parameter names and values per benchmark in the JSON output (b/132578772)
  • Dry Run mode (b/138785848)
    • Added a "dry run" mode for running each benchmark loop only once, to check for errors/crashes without capturing measurements. This can be useful e.g. for, for example, quickly running benchmarks in presubmit to check that they're not broken.

API changes

  • Module structure has changed, splitting the library (b/138451391)
    • benchmark:benchmark-junit4 contains classes with JUnit dependency: AndroidBenchmarkRunner, and BenchmarkRule, both of which have moved into the androidx.benchmark.junit4 package
    • benchmark:benchmark-common contains the rest of the logic, including the BenchmarkState API
    • This split will allow the library to support benchmarking without JUnit4 APIs in the future
  • Configuration warnings are now treated as errors, and will crash the test (b/137653596)
    • This is done to further encourage accurate measurements, especially in CI
    • These errors can be reduced back to warnings with an instrumentation argument. For example: -e androidx.benchmark.suppressErrors "DEBUGGABLE,LOW_BATTERY"

Bug fixes

  • Errors when writing to external storage on Q devices provide more-descriptive messages, with suggestions of how to resolve the issue
  • Screens are automatically turned on during benchmark runs, instead of failing when the screen is off

External contributions

  • Thanks to Sergey Zakharov for contributing JSON output improvements and the fix for screen off issues!

Version 1.0.0-alpha03

July 2, 2019

androidx.benchmark:benchmark:1.0.0-alpha03 and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha03 are released. The commits included in this version can be found here.

New features

  • Expose sleep duration due to thermal throttling per benchmark in the full JSON report

Bug fixes

  • The Gradle plugin should no longer be required to be applied after Android plugins and the Android block
  • Adds support for benchmark reports on Android 10 devices using scoped storage

Version 1.0.0-alpha02

June 6, 2019

androidx.benchmark:1.0.0-alpha02 and androidx.benchmark:benchmark-gradle-plugin:1.0.0-alpha02 are released. The commits included in this version can be found here.

Note that we are treating the JSON schema as an API. We plan to follow the same stability constraints as other APIs: stable (with very rare exceptions) once in beta, and fixed in final release, with only additions in minor releases and changes/removals in major releases.

API changes

  • Overhauled JSON schema. Further changes to the JSON schema are likely to be limited to additions:

    • Reorganized the result object structure to support additional metric groups in the future (b/132713021)
    • Added test run context information, such as device and build info and whether clocks are locked, to the top-level object (b/132711920)
    • Time metric names now have ‘ns’ in their name (b/132714527)
    • Additional stats added per reported metric (maximum, median, minimum), and removed simplified 'nanos' summary stat (b/132713851)
  • Removed XML output (b/132714414)

  • Thermal throttle detection removed from BenchmarkState.reportData API (b/132887006)

Bug fixes

  • Fixed ./gradlew lockClocks not sticking on some recent OS devices (b/133424037)
  • Throttling detection disabled for emulator (b/132880807)

Version 1.0.0-alpha01

May 7, 2019

androidx.benchmark:benchmark:1.0.0-alpha01 is released. The commits included in this version are available here.