I just tried an app with a LazyColumn on a device ...
# compose
p
I just tried an app with a LazyColumn on a device and it is really laggy. Its a small example app with hardly any code in it. I would still expect better performance. I think doing a release build helps a bit. Any suggestions of what else could be affecting performance ?
2
s
It is fast only in release mode with R8 minimizations applied. Alternatively, you can force full AOT on your device to make it run even faster. I tested LazyColumn with arbitrary length text elements on my Nexus 5 (2013). In different modes, it works very differently, you should not judge raw debug builds.
raw debug build, no R8 - JIT is running, it is very slow
release build + R8 minifications applied - much better, but JIT is still there
release build + R8 + full AOT - you can see the difference
you can trigger full AOT by running
adb shell cmd package compile -r bg-dexopt your_pkg_name
right after you installed your app.
🙌 1
p
Thanks @Sergey Y. I did test the release build with R8 enabled it was a bit better but still a bit jerky it wasn't as good as as recycler view. I will test it now with full AOT
s
if even after all the optimizations there are performance problems, then most likely the problem is in the application code, you need to profile and look for the cause.
As you can see, JP Compose can work well on hardware that is 8 years old.
Alternatively you can test the Tivi app, it is also written in Compose. Source code: https://github.com/chrisbanes/tivi Google Play: https://play.google.com/store/apps/details?id=app.tivi
s
@dan.the.man