Benchmarking in AndroidX

The public documentation at d.android.com/benchmark explains how to use the library - this page focuses on specifics to writing libraries in the AndroidX repo, and our continuous testing / triage process.

There are two types of benchmarks, summarized below:

MacrobenchmarkMicrobenchmark
FunctionMeasure high-level entry pointsMeasure individual functions.
: : or interactions, such as : :
: : activity launch or scrolling a : :
: : list. : :
ScopeOut-of-process test of fullIn-process test of CPU work.
: : app. : :
SpeedMedium iteration speed. It canFast iteration speed. Often
: : exceed a minute. : less than 10 seconds. :
TracingResults come with systemResults come with a minimal
: : traces. : system trace and a method trace :
: : : by default. :

For continuous testing, triage, and regression tracking, see Monitoring Benchmarks.