🌐
Android Developers
developer.android.com › app quality › microbenchmark
Microbenchmark | App quality | Android Developers
The Jetpack Microbenchmark library lets you benchmark your Android native code—Kotlin or Java—from within Android Studio.
🌐
GitHub
github.com › android › performance-samples
GitHub - android/performance-samples: Samples to show APIs and best practices in Performance on Android
A collection of samples using the performance libraries. You can learn more about Android Performance at https://d.android.com/performance.
Starred by 1.4K users
Forked by 234 users
Languages   Kotlin 92.7% | TypeScript 7.0% | Shell 0.3%
🌐
Android Developers
developer.android.com › app quality › write a macrobenchmark
Write a Macrobenchmark | App quality | Android Developers
The library outputs benchmarking results to both the Android Studio console and a JSON file with more detail.
🌐
Android Developers
developer.android.com › app quality › benchmark your app
Benchmark your app | App quality | Android Developers
Android offers two benchmarking libraries and approaches for analyzing and testing different kinds of situations in your app: Macrobenchmark and Microbenchmark.
🌐
Android Developers
developer.android.com › get started › jetpack › benchmark
Benchmark | Jetpack | Android Developers
This library now targets Kotlin 2.0 language level and requires KGP 2.0.0 or newer. (Idb6b5) ... androidx.benchmark:benchmark-*:1.4.0-alpha10 is released.
🌐
Android Developers
developer.android.com › app quality › write a microbenchmark
Write a Microbenchmark | App quality | Android Developers
Benchmarks are standard instrumentation tests. To create a benchmark, use the BenchmarkRule class provided by the library. To benchmark activities, use ActivityScenario or ActivityScenarioRule.
🌐
Google
android.googlesource.com › platform › frameworks › support › + › androidx-main › docs › benchmarking.md
Benchmarking in AndroidX
Just use the BenchmarkRule provided by the library: @RunWith(AndroidJUnit4::class) class ViewBenchmark { @get:Rule val benchmarkRule = BenchmarkRule() @Test fun simpleViewInflate() { val context = InstrumentationRegistry .getInstrumentation().targetContext val inflater = LayoutInflater.from(context) val root = FrameLayout(context) benchmarkRule.measure { inflater.inflate(R.layout.test_simple_view, root, false) } } }
🌐
Android Developers
developer.android.com › app quality › benchmark baseline profiles with macrobenchmark library
Benchmark Baseline Profiles with Macrobenchmark library | App quality | Android Developers
@RunWith(AndroidJUnit4ClassRunner::class) class ColdStartupBenchmark { @get:Rule val benchmarkRule = MacrobenchmarkRule() // No ahead-of-time (AOT) compilation at all. Represents performance of a // fresh install on a user's device if you don't enable Baseline Profiles— // generally the worst case performance.
🌐
The Android Mjolnir
jaydroid254.hashnode.dev › demystifying-app-performance-a-guide-to-application-benchmarking-in-android
Exploring the Macrobenchmark Library in Android.
August 11, 2023 - The Macrobenchmark library is specifically created to work seamlessly with Android development. It is capable of benchmarking not only mobile applications but also custom-built Android libraries.
Find elsewhere
🌐
Mindorks
blog.mindorks.com › improving-android-app-performance-with-benchmarking
Improving Android app performance with Benchmarking
The Jetpack Benchmark Libray is a tool for measuring code performance and is used to remove those common mistakes that we were doing earlier while using Benchmark. This library handles warmup, measure your code performance and output the result ...
🌐
Medium
medium.com › androiddevelopers › whats-new-in-jetpack-benchmark-1-2-0-82da5092fc43
What’s new in Jetpack Benchmark 1.2.0 | by Ben Weiss | Android Developers | Medium
October 20, 2023 - All these features are provided by the androidx.benchmark library group. Despite the minor version increment from 1.1.1 to 1.2.0, a lot of new features have been added.
🌐
GitHub
github.com › azabost › spanner
GitHub - azabost/spanner: A microbenchmark library for Android
Spanner is a micro benchmarking framework designed to run on Android.
Author   azabost
🌐
Google
android.googlesource.com › platform › frameworks › support › + › 870f4590b5d3749d6275497c30a1520998372e42 › benchmark › docs › macrobenchmark.md
Jetpack Macrobenchmark Guide
Metrics are displayed directly in Android Studio, and also output for CI usage in a JSON file. While the existing Jetpack Benchmark library allows you to benchmark app code directly in a loop, it's designed around measuring CPU work which is run frequently, and which will hit best-case performance ...
🌐
CircleCI
circleci.com › blog › benchmarking-android
Benchmarking Android applications in CI/CD pipelines | CircleCI
July 27, 2021 - This prevents performance regressions from reaching your users as you add new features and other improvements. We used the new Android Jetpack macrobenchmarking library and showed ways to integrate it with Firebase Test Lab to run benchmarks ...
🌐
Google
android.googlesource.com › platform › external › google-benchmark
platform/external/google-benchmark - Git at Google
To run the benchmark, compile and link against the benchmark library (libbenchmark.a/.so).
🌐
Android Developers
developer.android.com › codelabs › android-macrobenchmark-inspect
Inspect app performance with Macrobenchmark | Android Developers
In this codelab you'll learn to use the macrobenchmark library. You will measure app startup timing, which is a key metric for user engagement, and frame timing, which hints at where jank may occur in your app.
🌐
Reddit
reddit.com › r/androiddev › what you guys use for code benchmark?
r/androiddev on Reddit: What you guys use for code benchmark?
December 31, 2023 -

In recent blog, jake gave these metrics / benchmarks https://jakewharton.com/perils-of-duplicate-finding/#benchmarks. I want to, how to get this benchmarks. I too wanna test my code for TOE. So i some know how to achieve this. I have used difference in System.currentTimeinMillis() before and after the function. Can you suggest other alternative as this is not reliable metric?

🌐
Bugfender
bugfender.com › blog › android-macrobenchmark
Android Macrobenchmark: Real-World Performance Testing for Apps | Bugfender
June 18, 2025 - Macrobenchmark is a Jetpack library for testing how your app performs during full user flows, startup, scrolling, transitions, or anything you can simulate through the UI. It runs on real devices or emulators, and it aims to replicate actual ...