louiscad
10/16/2022, 2:42 PMScalingLazyColumn
is incredibly, mind blowingly, fascinatingly… extremely laggy, even in release builds… 😕
You don't even get 10fps!
How is that possible? I tested on the Pixel Watch and the Samsung Galaxy Watch 4.
Is Google using these in their apps with some tricks, or is Google using only View APIs?
Here's my code:
import androidx.wear.compose.foundation.CurvedLayout
import androidx.wear.compose.material.AutoCenteringParams
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.ScalingLazyColumn
import androidx.wear.compose.material.Text
import androidx.wear.compose.material.ToggleChip
import androidx.wear.compose.material.ToggleChipDefaults
import androidx.wear.compose.material.curvedText
import androidx.wear.compose.material.rememberScalingLazyListState
@Composable
fun SomeScreenContent() {
ScalingLazyColumn(
Modifier.fillMaxSize(),
state = listSate,
autoCentering = AutoCenteringParams(itemIndex = 0),
) {
items(20) {
ToggleChip(
checked = false,
onCheckedChange = { isChecked -> },
label = {
Text("Some setting")
},
toggleControl = {
Icon(
imageVector = ToggleChipDefaults.switchIcon(checked = false),
contentDescription = "setting disabled"
)
}
)
}
}
}
louiscad
10/16/2022, 2:58 PMyschimke
10/16/2022, 3:24 PMlouiscad
10/16/2022, 3:25 PMyschimke
10/16/2022, 3:25 PMyschimke
10/16/2022, 3:26 PMyschimke
10/16/2022, 3:26 PMlouiscad
10/16/2022, 3:27 PMlouiscad
10/16/2022, 3:27 PMyschimke
10/16/2022, 3:28 PMlouiscad
10/16/2022, 3:34 PMbod
10/16/2022, 3:35 PMyschimke
10/16/2022, 3:36 PMlouiscad
10/16/2022, 3:37 PMyschimke
10/16/2022, 3:39 PMyschimke
10/16/2022, 3:40 PMlouiscad
10/16/2022, 3:42 PMWearableRecyclerView
and putting `ComposeView`s inside it. Worked well in a phone app at my previous job where I needed insert/removal animationsyschimke
10/16/2022, 3:44 PMlouiscad
10/16/2022, 3:44 PMlouiscad
10/16/2022, 3:45 PMScalingLazyColumn
louiscad
10/16/2022, 3:50 PMyschimke
10/16/2022, 3:50 PMlouiscad
10/16/2022, 3:51 PMKseniia Shumelchyk
10/16/2022, 4:17 PMKseniia Shumelchyk
10/16/2022, 4:19 PMKseniia Shumelchyk
10/16/2022, 4:23 PMThomas
10/16/2022, 4:30 PMScalingLazyColumn
in production and it works flawlessly. On my Watch4 there are no performance issues at all when scrolling. Also the list is much more advanced than your example. I am using R8, but apart from that not really anything special.Thomas
10/16/2022, 4:32 PMlouiscad
10/16/2022, 4:49 PM[status=verify] [reason=boot]
blob thinking fastlouiscad
10/16/2022, 4:54 PMadb shell cmd package bg-dexopt-job
it takes a lot more than 40 seconds on the Pixel Watch, it's been 3 minutes and counting 🤔louiscad
10/16/2022, 4:56 PM[status=speed-profile] [reason=bg-dexopt]
, but it's still super laggy 😭louiscad
10/16/2022, 4:57 PMKseniia Shumelchyk
10/16/2022, 5:13 PMlouiscad
10/16/2022, 5:14 PMlouiscad
10/16/2022, 5:16 PMlouiscad
10/16/2022, 5:17 PMlouiscad
10/16/2022, 5:18 PMyschimke
10/16/2022, 5:22 PMlouiscad
10/16/2022, 5:22 PMyschimke
10/16/2022, 5:23 PMlouiscad
10/16/2022, 5:24 PMlouiscad
10/16/2022, 5:25 PMlouiscad
10/16/2022, 5:25 PMKseniia Shumelchyk
10/16/2022, 5:25 PMlouiscad
10/16/2022, 5:28 PMlouiscad
10/16/2022, 5:30 PMlouiscad
10/16/2022, 5:30 PMlouiscad
10/16/2022, 5:38 PMlouiscad
10/16/2022, 5:45 PMlouiscad
10/16/2022, 6:39 PMinstallRelease
Gradle task. Not smooth most of the time.louiscad
10/16/2022, 6:42 PMlouiscad
10/17/2022, 12:25 AMWearableRecyclerView
embedding `ComposeView`s, using the latest versions of everything to get the latest performance improvements…
I now have a comparison where the app auto-switches between ScalingLazyColumn
and `ScalingLazyColumnWithRecyclerView`…
You'll the thing getting less janky over the scrolls, with one that gets there quicker…
We have a teal-ish background for one, and a green-ish background for the other one. Can you guess which is which from that video?John Nichol
10/17/2022, 10:53 AMstevebower
10/17/2022, 2:13 PMstevebower
10/17/2022, 4:05 PMlouiscad
10/17/2022, 5:56 PMlouiscad
10/17/2022, 8:03 PMJohn Nichol
10/17/2022, 8:32 PMlouiscad
10/17/2022, 10:46 PMlouiscad
10/17/2022, 10:46 PMyschimke
10/18/2022, 3:19 PMyschimke
10/18/2022, 3:19 PMyschimke
10/18/2022, 3:20 PMScrollingBenchmark_startup[compilation=None]
frameDurationCpuMs P50 11.5, P90 27.5, P95 42.1, P99 138.9
ScrollingBenchmark_startup[compilation=BaselineProfile]
frameDurationCpuMs P50 10.8, P90 20.9, P95 31.5, P99 81.1
yschimke
10/18/2022, 3:20 PMyschimke
10/18/2022, 3:20 PMlouiscad
10/18/2022, 3:24 PMyschimke
10/18/2022, 3:49 PMyschimke
10/18/2022, 3:49 PMyschimke
10/18/2022, 3:50 PMyschimke
10/18/2022, 3:52 PMlouiscad
10/18/2022, 4:00 PMbod
10/18/2022, 4:12 PMP
for 16msyschimke
10/18/2022, 4:18 PMyschimke
10/18/2022, 4:20 PMlouiscad
10/24/2022, 7:49 PMyschimke
10/25/2022, 12:10 PMbod
10/25/2022, 12:50 PMlouiscad
10/25/2022, 12:50 PMTheme.Wallpaper
descendant