0.3.20
This commit is contained in:
+23
-3
@@ -39,13 +39,33 @@ class BaselineProfileGenerator {
|
||||
browseHome()
|
||||
}
|
||||
|
||||
/**
|
||||
* Walks the launcher the way a viewer does, and walks it *vertically*.
|
||||
*
|
||||
* Two Down presses were not enough. Moving between shelves is the most expensive thing
|
||||
* the launcher does — a row is composed as it scrolls in, the focus request is posted
|
||||
* and consumed, and the hero catches up behind it — and none of that was in the profile,
|
||||
* so on a television it ran interpreted. Measured on a Chromecast with Google TV, that
|
||||
* was the difference between a 72ms and a 10ms recomposition at the 90th percentile.
|
||||
*
|
||||
* The walk goes down far enough to compose shelves beyond the first viewport and back up
|
||||
* again, because entering a row from below is a different path from entering it from
|
||||
* above, and both are on the D-pad.
|
||||
*/
|
||||
private fun MacrobenchmarkScope.browseHome() {
|
||||
repeat(4) { device.pressKeyCode(KeyEvent.KEYCODE_DPAD_RIGHT) }
|
||||
device.waitForIdle()
|
||||
device.pressKeyCode(KeyEvent.KEYCODE_DPAD_DOWN)
|
||||
repeat(6) {
|
||||
device.pressKeyCode(KeyEvent.KEYCODE_DPAD_DOWN)
|
||||
device.waitForIdle()
|
||||
}
|
||||
// Travelling a shelf is what pulls in the card, artwork and metadata composables
|
||||
// for a row that was composed by a vertical move rather than by the first frame.
|
||||
repeat(3) { device.pressKeyCode(KeyEvent.KEYCODE_DPAD_RIGHT) }
|
||||
device.waitForIdle()
|
||||
device.pressKeyCode(KeyEvent.KEYCODE_DPAD_DOWN)
|
||||
device.waitForIdle()
|
||||
repeat(6) {
|
||||
device.pressKeyCode(KeyEvent.KEYCODE_DPAD_UP)
|
||||
device.waitForIdle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user