Optimizing Render Performance of Jetpack Compose with William Shelor

Android Worldwide · 12K views · 2021 · 53:50

Open on YouTube

Software performance & optimizationSoftware architecture & designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about laggy Compose UIs, LazyColumn jank, and Compose performance in general.

Recommended by 2 people across 2 different months, 2021 to 2022.

What it is

A conference talk from Android Worldwide in which William Shelor explains why Jetpack Compose can feel slow and presents five ways to improve its rendering performance. It covers using Compose in fast and slow ways, with practical optimization advice for Compose apps.

What people said

Recommends CommonsWare · 2021-11 · Stack Overflow · on “Jetpack compose performance”

That is partly a question of tooling (enable R8 on `debug` builds, wait for JIT to take effect) and partly a question of your code (as you can have poor performance in a `RecyclerView` as well). See this video [this video] for some advice, and see this material [LINK] for one specific source of difficulty (overcomposing, where you cause excessive recompositions). You might also consider asking a separate SO question with a [mcve] for help with your specific code.

Recommends chuckj · 2022-01 · Stack Overflow · on “Laggy Lazy Column Android Compose”

Also consider watching [this video] which contains a lot of great information about how to optimize a compose application (including the information you discovered from reddit).

Cites Mattia Ferigutti · 2022-01 · Stack Overflow · on “Laggy Lazy Column Android Compose”

Things will speed up your Lazy List If you're in debug mode, that's normal . Don't worry if your app is laggy in debugging. It's completely fine. Just create the APK in release mode (Build -> Generated Signed Bundle/APK), which might solve your problem. This happens because when in debugging, Compose translates bytecode in runtime using JIT. Make sure you're also using the R8 compiler in the release build. This is extremely important to improve general performance, mostly for lambda expressions which are heavily used in compose. Set a key for your item . Initialize your Lazy list like this. LazyColumn() { items( count = cartItems.size, key = { cartItems[it].cartItem.id }, itemContent = { ind

Cites Thracian · 2022-07 · Stack Overflow · on “Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed”

Putting Composables inside a RecyclerView as items might hinder your performance. In this video it's not advised. [this video]