-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Still too many recompositions #1431
Comments
This is what I have been working on for the past few weeks. Still nowhere near complete but I have managed to prevent the feed from constantly recomposing. (Pinned the topbar solely for easier showcasing as its enter behaviour triggers more recompositions, which it probably shouldn't but no clue on solving that yet) h2IYPMyFyr.mp4It now only updates the item that has changed. But even further might be possible, as its currently fully recomposing that item and the upvote only changes one thing that is the score. So everything else that doesn't change should stay the same. But this is probably the same as the feed due to its immutable nature. olditem ~= newItem and we pass this PostView pretty much into each composable. Thus each composable its arguments are different and recomposes. |
Jerboa Version
0.0.60
Description
I did some more research into recompositions in Jerboa.
Before:
Notice how every frame the upvote/downvote/ other actions buttons recompose
But the comment counts don't? Well thats how everything supposed to be in a post
l1nbIFVqRW.mp4
I added 1 remember for upvote action
after:
The upvote doesn't recompose anymore, and only changes when its state changes (pressing upvote) pressing an action also doesn't recompose the other upvotes
4fOPBIRiM6.mp4
Exact change in postlisting.kt:
Conclusion:
We need to add way more remembers for every top action passed down.
@dessalines
The text was updated successfully, but these errors were encountered: