Garima Jain

Principal Android Engineer at GoDaddy Studio

Talk Title

The diffing dilemma! All about diffing, from RecyclerView to LazyLists






13:25 > 40 min


on Twitter

These days, there is a lot of buzz around Compose and its Lazy Lists, which are undeniably great. However, many codebases and applications still rely on RecyclerView, and some are still weighing the pros and cons of switching to lazy lists of Compose.

Recently, I have been exploring the pros and cons of migrating from RecyclerView to Compose’s lazy lists. As we heavily use MVI at my company, it was essential to ensure proper diffing in the UI. Although we knew that Compose works well with MVI by recomposing only the desired portion of the view, the diffing mechanism of lists is slightly different which was still unexplored and thus led to this talk.

In this talk, we will understand how diffing is done in the context of RecyclerView. We will then explore how the good old DiffUtil's `areItemsTheSame` and `areContentsTheSame` translate into the world of Compose. In the process, we will also delve deeper into LazyList internals, including the lazy list's policy for reusing items using keys and content types.

By the end of this talk, my goal is to provide guidance to those
1. Still using RecyclerView to follow best practices
2. Looking for answers before migrating to Compose’s LazyList
3. Already using LazyLists to improve their performance

Additional tag: General Android

Speaker Bio

Garima Jain, Android GDE, also known as @ragdroid is working as a Principal Android Engineer at GoDaddy Studio (previously Over). She is also an international speaker and an active technical blogger.