Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

566
Visualizações
Jetpack Compose lazycolumn performance

I'm new to jetpack compose and learning it from code of JetpackCompose Basics so I have found in the create a performant lazy list

Note: LazyColumn doesn't recycle its children like RecyclerView. It emits new Composables as you scroll through it and is still performant, as emitting Composables is relatively cheap compared to instantiating Android Views.

so how emitting new composable is cheap and performant, and then why not to just using column and compose the whole list for one time instead of keep emitting composable items while scrolling even if the emitting composables is only the items visible by layout

Update : if the visible items is 10, so before user scroll the items from 0 to 9 is visible and has been rendered, now the user has scrolled up and the visible items from 5 to 14, is jetpack compose removed the 5 items that have been previously rendered and if user scroll down, they will be recomposed or jetpack compose keep all rendered views in memory no matter if it visible or not

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Because there's a limit to the definition of "cheap", but no limit to how big a list can be. It may be cheap to output 100-200 composables (which I'm not convinced of, but lets say so for the sake of argument). It isn't cheap to output 10K of them. Which a list of results backed by a DB could easily be.

So you still don't want to output everything all time time. But it may be relatively cheap to output everything a user would reasonably scroll to, because nobody goes to the end of a 10K list. Thus making it a reasonable compromise based on common user behavior. You'd lose performance as they scroll further down the page, but the percentage of users who do that is small enough you may not care.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda