This commit is contained in:
ponzischeme89
2026-08-23 20:25:20 +12:00
parent 5107c4b0fc
commit 6ba8728dce
15 changed files with 185 additions and 96 deletions
@@ -63,6 +63,24 @@ class HomeBenchmark {
measureBlock = { exerciseHome() },
)
/**
* Keeps the remote moving long enough to expose allocation, image-cache and GC churn
* that a single trip through the first four shelves can hide. Run this on a constrained
* television as the sustained-navigation gate for Home, Shows and Movies rows.
*/
@Test
fun sustainedHomeDpadNavigation() = benchmarkRule.measureRepeated(
packageName = PACKAGE_NAME,
metrics = listOf(FrameTimingMetric()),
compilationMode = CompilationMode.Partial(),
startupMode = StartupMode.WARM,
iterations = 3,
setupBlock = { startActivityAndWait() },
measureBlock = {
repeat(SUSTAINED_CYCLES) { exerciseHome() }
},
)
private fun MacrobenchmarkScope.exerciseHome() {
// Do not wait between presses: a real performance problem is most visible while a
// viewer holds the remote and focus animations, lazy composition and image decode
@@ -91,5 +109,6 @@ class HomeBenchmark {
const val HORIZONTAL_PRESSES = 12
const val HORIZONTAL_PRESSES_PER_ROW = 6
const val VERTICAL_PRESSES = 4
const val SUSTAINED_CYCLES = 8
}
}