Benchmark

The Benchmark library makes it easy to benchmark your Kotlin-based or Java-based code from within Android Studio. The library handles warmup, measures your code performance, and outputs benchmarking results to the Android Studio console.

For information on how to use the Benchmark library in your app or library, see Benchmark app code.

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:

project_root/module_dir/build.gradle

dependencies {
  androidTestImplementation
    "androidx.benchmark:benchmark:1.0.0-alpha01"
}

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

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.