Marko Novaković
10/23/2023, 10:12 PMgoogle-maps-compose
.
Compose
1-1 copy of View
map version has terrible performance with same data set.
problem is with clustering and cluster items.
everything works fine until I zoom in to the point where individual cluster items show.
when individual cluster items should be showing app just freezes and gives me ANRs.
it even freezes when there is cluster with 5 items and when I zoom to see those 5 items.
I tested with 100 and 150 markers/cluster items and it works perfectly fine. I don’t know the threshold when issue starts appearing.
log shows 800, 1000, 1500 frames skipped one after another.
cluster item are custom markers/xml vector icons. exactly the same xml vector icons are used in View system map version.
somebody faced same issue? any suggestions?Ulf
10/24/2023, 6:08 AMStrictMode.ThreadPolicy.Builder()
.detectAll()
When I changed to
StrictMode.ThreadPolicy.Builder()
.detectAll()
.permitDiskReads()
The lagging is gone!!
Not a solution - but a workaround that worked for me...if (strictModeEnabled) {
DisposableEffect(Unit) {
val prevThreadPolicy = StrictMode.allowThreadDiskReads()
onDispose {
StrictMode.setThreadPolicy(prevThreadPolicy)
}
}
}
Marko Novaković
10/24/2023, 7:56 AMUlf
10/24/2023, 8:00 AMMarko Novaković
10/24/2023, 8:02 AMpermitDiskReads
right nowUlf
10/24/2023, 8:04 AMMarko Novaković
10/24/2023, 8:14 AM