Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Hello,
This issue report has been forwarded to the Vertex AI Workbench Engineering team so that they may investigate it, but there is no ETA for a resolution today. Future updates regarding this issue will be provided here.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 6db0f4e9c3de0d0d756cc7e4992613b15f248a51
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Nov 20 15:12:06 2020
Automatically insert graphics layers for items of LazyColumn/Row
Depending on the item content it can improve the drawing performance up to 70% percent when we scroll without composing the new elements as instead of redrawing the items content on every scroll offset we just move the associated RenderNodes.
Fixes: 170296989
Test: new tests to verify items are not redrawn
Change-Id: I8eaddbae2cf8548c3b972cddb46f537a3989e0cd
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyColumnForTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyRowForTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/integration-tests/benchmark/src/androidTest/java/androidx/compose/ui/lazy/LazyListScrollingBenchmark.kt
https://android-review.googlesource.com/1507498
Branch: androidx-master-dev
commit 6db0f4e9c3de0d0d756cc7e4992613b15f248a51
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Nov 20 15:12:06 2020
Automatically insert graphics layers for items of LazyColumn/Row
Depending on the item content it can improve the drawing performance up to 70% percent when we scroll without composing the new elements as instead of redrawing the items content on every scroll offset we just move the associated RenderNodes.
Fixes: 170296989
Test: new tests to verify items are not redrawn
Change-Id: I8eaddbae2cf8548c3b972cddb46f537a3989e0cd
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyColumnForTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyRowForTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/integration-tests/benchmark/src/androidTest/java/androidx/compose/ui/lazy/LazyListScrollingBenchmark.kt
Description
LazyColumnFor(items) {
Text("$it", Modifier.background(Color.Red))
}
We scroll such list few pixels(no new items composed as a result)
Draw performance is: 124397 ns
Now we add a layer
LazyColumnFor(items) {
Text("$it", Modifier.drawLayer().background(Color.Red))
}
Draw performance is: 63371 ns (50% less)
Use case 2
LazyColumnFor(items) {
var color by remember { mutableStateOf(Color.Red) }
Text("$it", Modifier.clickable(indication = null) {
color = Color.Green
}.drawBehind {
drawRect(color)
})
}
Invalidating only one item:
Without layers on each item: 1137259 ns
With layers: 113771 ns (90% less).
We should have a way for a layouts to insert layers for children