Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reduce recompositions due to TopAppBar#1542

Merged
dessalines merged 2 commits into
LemmyNet:mainfrom
MV-GH:perf/reduce-recomp
Jun 13, 2024
Merged

Reduce recompositions due to TopAppBar#1542
dessalines merged 2 commits into
LemmyNet:mainfrom
MV-GH:perf/reduce-recomp

Conversation

@MV-GH

@MV-GH MV-GH commented Jun 9, 2024

Copy link
Copy Markdown
Collaborator

When you swipe up and down the top app bar moves. This updates the padding value. All composable which take this as param constantly recompose because the padding constantly changes as the header takes up more/less space. We can avoid that by applying it before the main composables. I had already done this for the feed. But we can do this easily already for the other screens.

@MV-GH MV-GH requested a review from dessalines as a code owner June 9, 2024 00:47

@dessalines dessalines left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully some of the newer jetpack compose tutorials should really tell you about that: to not pass in padding values as it will cause a ton of these recompositions.

@dessalines dessalines enabled auto-merge (squash) June 13, 2024 15:35
@dessalines dessalines merged commit 6b74822 into LemmyNet:main Jun 13, 2024
@MV-GH MV-GH deleted the perf/reduce-recomp branch June 13, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants