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
Sergey Y.
08/14/2021, 3:37 PM
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
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
Sergey Y.
08/14/2021, 3:47 PM
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.