android / performance-samples

Samples to show APIs and best practices in Performance on Android

Home Page:https://d.android.com/topic/performance/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch to benchmark test runner

yschimke opened this issue · comments

Macrobenchmark now prompts to use this, so samples should probably follow the advice.

androidx.benchmark.junit4.AndroidBenchmarkRunner

https://developer.android.com/reference/kotlin/androidx/benchmark/junit4/AndroidBenchmarkRunner

Macrobench shouldn't prompt to use this, this was a bug where it shared micro warnings, should be fixed in next alpha. Fixed in https://android-review.git.corp.google.com/c/platform/frameworks/support/+/2617495

Is it a bad idea to use this runner? I changed another project already.

It's only needed for microbenchmarks, but it's set automatically by the androidx.benchmark gradle plugin. The warning shouldn't show up for macrobenchmarks - and actually, I didn't ever see it for macro in internal AndroidX builds, not sure why not though.

In my case I have some macrobenchmark run with a service (media session), so I suspect my case is still valid.