Is it just me or is `LazyColumn` rather laggy on f...
# compose
u
Is it just me or is
LazyColumn
rather laggy on first scroll? Compared to Column with scroll (obviously since those are eagerly loaded), but also compared to RecyclerView (by feel, didnt measure though) and fling animation is also kind of messed up, but then fixes it self after few swipes up and down; as if something heavy was loading on main thread
13
s
Did you try on the Realese build? Performance on release build is much better.
n
Yeah it is same on my side as well. Tried on release build. Also bottom navigation item switching is lagging as well.
u
@Namig Tahmazli does release make it better? ofcourse new AS won't sign my release build and I gave up
s
I have a grid using LazyColumn\LazyVerticalGrid and it's a nightmare using it on Android 6. It's like the app is running on 5 fps. RecyclerView worked great on Android 6. I'm working on a reproducible example rn to file an issue
Release makes it better but it's still really slow in my case and I can't release the app for production
2
s
Hopefully "Support multithreaded scheduler" on the compose roadmap will improve performance 🤞
n
@ursus I did not see noticeable difference when using release build. It starts lagging initially and then becomes smoother.
z
That “slow at first, then better” sounds like it might be a JIT compilation thing. I’m not sure what the current status is but I think the Compose team is working to provide optimization profiles for the play store so that android will AOT compile hot Compose code before you run the app – that might address this issue. I’m also not sure how those work for sideloaded apps, other app stores, etc.
m
https://developer.android.com/jetpack/compose/ergonomics#profile-inst Theoretically it should only be an issue on debug builds. I think Adam Powell also mentioned that minifying might be beneficial
c
If you have a repro case of really bad perf, I would file a bug. Romain has said that they are taking a look at each perf issue closely.
n
I tried it on Jetsnack, release build, minify enabled. I am able to reproduce lagging when switching tabs. If feels like some heavy data is being loaded on each screen when switching to. Same applies to LazyColumn. 🤷‍♂️
c
I'd file a bug with exactly that information then. 😅 I'll star it if you post it here.
d
@Zach Klippenstein (he/him) [MOD] in other words, compose apps will run smoothly only when downloaded from playstore? great
z
I hope not, as I said I believe the play store is one way these profiles can be delivered but I’m sure there are others
👍 1
s
u
I dont feel like this is a JIT issue, since Column with versictalScroll works fine, I think its related to the lazyness; but I dont really know
z
Well they have very different implementations, and lazy lists do a lot more work, so it could be that they benefit more from AOT
u
I mean yea I expect debug builds to be slower even with recyclerview, and app startup etc, but this is a bit lot, not really prod ready tbh, and its a hello world app for me, just a simple card list layout
453 Views