Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 4bb5026491f04f591f29e3baccafed1cc41a54f5
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Apr 16 17:08:52 2021
Preparation for allowing SubcomposeLayoutState hoisting
In this cl we decrease the amount of public members in SubcomposeLayoutState class by not implementing SubcomposeMeasureScope and RememberObserver anymore.
Bug: 184940225
Test: run SubcomposeLayoutTest
Change-Id: I42642be1b8373792b6db6075b2121b64388696c2
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt
https://android-review.googlesource.com/1678089
Branch: androidx-main
commit 4bb5026491f04f591f29e3baccafed1cc41a54f5
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Apr 16 17:08:52 2021
Preparation for allowing SubcomposeLayoutState hoisting
In this cl we decrease the amount of public members in SubcomposeLayoutState class by not implementing SubcomposeMeasureScope and RememberObserver anymore.
Bug: 184940225
Test: run SubcomposeLayoutTest
Change-Id: I42642be1b8373792b6db6075b2121b64388696c2
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 804e0e63fcaaba34c88f24faa2bb3b93fffd826c
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Apr 16 17:51:44 2021
Add precomposing logic for SubcomposeLayout
This will allow to add the prefetching logic during the scroll of LazyColumn/Row
Relnote: Introduces ability to hoist the SubcomposeLayout state which allows you to precompose the content into a requires slotId which would make the next measure pass faster as once we try to subcompose with the given slotId next time there will be no composition needed.
Bug: 184940225
Bug: 185784787
Test: new tests in SubcomposeLayoutTest
Change-Id: I425806be5ec3e36337e04558e6621fbe515b7cd8
M compose/ui/ui/api/1.0.0-beta07.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta07.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta07.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/SubcomposeLayoutTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
https://android-review.googlesource.com/1678090
Branch: androidx-main
commit 804e0e63fcaaba34c88f24faa2bb3b93fffd826c
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Apr 16 17:51:44 2021
Add precomposing logic for SubcomposeLayout
This will allow to add the prefetching logic during the scroll of LazyColumn/Row
Relnote: Introduces ability to hoist the SubcomposeLayout state which allows you to precompose the content into a requires slotId which would make the next measure pass faster as once we try to subcompose with the given slotId next time there will be no composition needed.
Bug: 184940225
Bug: 185784787
Test: new tests in SubcomposeLayoutTest
Change-Id: I425806be5ec3e36337e04558e6621fbe515b7cd8
M compose/ui/ui/api/1.0.0-beta07.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta07.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta07.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/SubcomposeLayoutTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 4f9e6724f169845b9ce6cb375a23a23b8beab574
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Apr 16 18:12:56 2021
Lazy list prefetch
Introducing the mechanism for prefetching the next item during the scrolling of LazyColumn/Row. The logic is pretty much the same as the one used in RecyclerView:
After every scroll we calculate what is the next index which would be visible if we continue scrolling the same direction and schedule the prefetching work after the frame. After every frame there could be a gap before the next frame is scheduled to be started. We can use this time to do extra work. In our case we would pre-compose the item which is about to be visible. This makes the frame which will need to introduce the new item with the given index faster as the composition pass is done already.
This change decreases the median frame time of TrivialListScrollBenchmark(95th percentile) by 35%.
Test: tested with a new LazyListPrefetcherTest and manually
Relnote: The next visible item prefetching logic is introduced for LazyColumn/Row
Fixes: 184940225
Change-Id: I8a4bc52322a5444e3782274822fa6d07f7c1d402
M compose/foundation/foundation/api/1.0.0-beta07.txt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_1.0.0-beta07.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_1.0.0-beta07.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyGridTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyItemStateRestoration.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyListPrefetcherTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyRowTest.kt
A compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/lazy/LazyListPrefetcher.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/lazy/Lazy.desktop.kt
https://android-review.googlesource.com/1673249
Branch: androidx-main
commit 4f9e6724f169845b9ce6cb375a23a23b8beab574
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Apr 16 18:12:56 2021
Lazy list prefetch
Introducing the mechanism for prefetching the next item during the scrolling of LazyColumn/Row. The logic is pretty much the same as the one used in RecyclerView:
After every scroll we calculate what is the next index which would be visible if we continue scrolling the same direction and schedule the prefetching work after the frame. After every frame there could be a gap before the next frame is scheduled to be started. We can use this time to do extra work. In our case we would pre-compose the item which is about to be visible. This makes the frame which will need to introduce the new item with the given index faster as the composition pass is done already.
This change decreases the median frame time of TrivialListScrollBenchmark(95th percentile) by 35%.
Test: tested with a new LazyListPrefetcherTest and manually
Relnote: The next visible item prefetching logic is introduced for LazyColumn/Row
Fixes: 184940225
Change-Id: I8a4bc52322a5444e3782274822fa6d07f7c1d402
M compose/foundation/foundation/api/1.0.0-beta07.txt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_1.0.0-beta07.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_1.0.0-beta07.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyGridTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyItemStateRestoration.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyListPrefetcherTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyRowTest.kt
A compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/lazy/LazyListPrefetcher.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/lazy/Lazy.desktop.kt
Description