ivy-wallet
ivy-wallet copied to clipboard
[Performance] Fix Unstable composables
Please confirm the following
- [X] I checked the current issues for duplicate issues.
What would you like to improve?
- Ivy Wallet is full of unstable composables that make the app slow.
- We should fix that by making the unstable parameters - stable.
Because...
- The app slow and lags when scrolling (losing frames) or animating.
Description
- Remove the unstable Composables baseline from https://github.com/Ivy-Apps/ivy-wallet/blob/main/ci-actions/compose-stability/ivy-compose-stability-baseline.txt
- Submit a draft PR so the "Compose stability" CI can execute and fail
- See the failure in the Compose Stability workflow - it'll show you which composable is unstable and what parameters cause that.
Fixing unstable composable
- Identify unstable parameters (the Compose Stability action will tell you)
- Fixing an unstbale parameter: (best to worse)
- Replace it with a primitive (e.g. String, Int, Double, ...)
- Replace
List/SetwithImmutableList/ImmutableSetfrom kotlinx Immutable collections - Explicitly mark as
@Immutableor@Stablefor classes
Read this https://developer.android.com/jetpack/compose/performance/stability.
Fix stability issues guide: https://developer.android.com/jetpack/compose/performance/stability/fix
Success Criteria
- Compose Stability CI action passes.
- You have fixed at least three unstable Composables.
- The app works as expected and doesn't crash.
Thank you @ILIYANGERMANOV for raising Issue #2965! 🚀 What's next? Read our Contribution Guidelines 📚.
Tagging @ILIYANGERMANOV for review & approval 👀
Note: Even if you fix 2 Composables it's still very helpful! But... in general the more you can fix the better 😄
I'm on it
Thank you for your interest @AMHaroun! 🎉 Issue #2965 is assigned to you. You can work on it! ✅
If you don't want to work on it now, please un-assign yourself so other contributors can take it.
Also, make sure to read our Contribution Guidelines.
@AMHaroun this guide by Google can help if you have any issues: https://developer.android.com/jetpack/compose/performance/stability/fix
Thank you @AMHaroun for fixing some composables! 🙌 I re-opened the issue since there are more. Help is still wanted and much appreciated. I'll keep re-opening until we fix all composables and completely remove the baseline
Bonus points: if we can prioritize the transactions list that's used on the Home screen. It's about replacing BigDecimal -> Double in the viewStates and the ViewModel + replacing LocalDateTime -> String and doing the date formatting in the ViewModel. It's a bigger change but this is the way to fix the scrolling performance
I would like to work on this. Could you assign this to me if nobody is working on it? @ILIYANGERMANOV
https://github.com/Ivy-Apps/ivy-wallet/blob/main/CONTRIBUTING.md
No longer needed after K2 enables Stong Skipping