Skip to content
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

[HOLD][HIGH] Migrate the main chat list to FlashList #33725

Open
roryabraham opened this issue Dec 28, 2023 · 33 comments
Open

[HOLD][HIGH] Migrate the main chat list to FlashList #33725

roryabraham opened this issue Dec 28, 2023 · 33 comments
Assignees
Labels
NewFeature Something to build that is a new item. Weekly KSv2

Comments

@roryabraham
Copy link
Contributor

HOLD on:

  • Comment linking to be 100% complete
  • The new architecture to be enabled (this is not a hard requirement but I have a hunch that this should wait on that too)

Problem

The main chat list is one of the most, if not the most important component in our app. If you scroll far or fast on this list, you may see frames drop. Furthermore, there are some known performance issues with this list (example). We have already migrated almost every other virtualized list in our app from FlatList to FlashList, because its performance is much better.

Solution

Let's build support for bidirectional pagination in FlashList, then enable it on the main chat list in E/App.

@roryabraham roryabraham added Monthly KSv2 NewFeature Something to build that is a new item. labels Dec 28, 2023
@roryabraham roryabraham self-assigned this Dec 28, 2023
Copy link

melvin-bot bot commented Dec 28, 2023

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Monthly KSv2 labels Dec 28, 2023
@roryabraham
Copy link
Contributor Author

I expect this to be on HOLD until sometime in February, if not later, so I'm moving this back to monthly

@roryabraham roryabraham added Monthly KSv2 and removed Weekly KSv2 labels Dec 28, 2023
@roryabraham
Copy link
Contributor Author

cc @muttmuure adding this to the New Expensify performance improvements project. I acknowledge that the problem statement is a bit of a reverse-solution but I think it's a good bet that this will provide substantial performance improvements, as FlashList is just much better for performance than FlatList. We've established that elsewhere where we've migrated to FlashList

@roryabraham
Copy link
Contributor Author

Still on HOLD

@melvin-bot melvin-bot bot added the Overdue label Feb 19, 2024
@roryabraham
Copy link
Contributor Author

on HOLD for comment linking

@roryabraham
Copy link
Contributor Author

roryabraham commented Mar 25, 2024

HOLD, but could come off HOLD soon. Unclear if we'll prioritize

@melvin-bot melvin-bot bot removed the Overdue label Mar 25, 2024
@melvin-bot melvin-bot bot added the Overdue label Apr 25, 2024
@garrettmknight
Copy link
Contributor

@roryabraham we good to take this off hold? If so, where do you think it might fit in a wave, if any? I'm not 100% on the significance of this migration beyond general, better performance.

@melvin-bot melvin-bot bot removed the Overdue label Apr 26, 2024
@roryabraham
Copy link
Contributor Author

Good question. As far as I know there's no significance beyond general, better performance of chat screens.

@quinthar quinthar changed the title [HOLD] Migrate the main chat list to FlashList LOW: [HOLD] Migrate the main chat list to FlashList May 12, 2024
@quinthar quinthar moved this from MEDIUM to LOW in [#whatsnext] #quality May 12, 2024
@muttmuure
Copy link
Contributor

@janicduplessis how is this going?

@janicduplessis
Copy link
Contributor

I've been working on some other tasks, but should be good to come back on this soon.

@muttmuure muttmuure moved this from LOW to CRITICAL in [#whatsnext] #quality Nov 12, 2024
@muttmuure muttmuure moved this from CRITICAL to LOW in [#whatsnext] #quality Nov 12, 2024
@muttmuure muttmuure moved this from LOW to HIGH in [#whatsnext] #quality Nov 19, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@mountiny
Copy link
Contributor

mountiny commented Dec 2, 2024

@janicduplessis @hannojg any updates here?

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
@muttmuure muttmuure changed the title LOW: Migrate the main chat list to FlashList HIGH Migrate the main chat list to FlashList Dec 2, 2024
@muttmuure muttmuure changed the title HIGH Migrate the main chat list to FlashList HIGH: Migrate the main chat list to FlashList Dec 2, 2024
@melvin-bot melvin-bot bot added the Overdue label Jan 3, 2025
@garrettmknight
Copy link
Contributor

@janicduplessis @hannojg same question! any updates here?

@melvin-bot melvin-bot bot removed the Overdue label Jan 6, 2025
@hannojg
Copy link
Contributor

hannojg commented Jan 7, 2025

Current status update to using FlashList

We are still in the process of trying to fix maintainVisibleScrollPosition for FlashList.

FlashList is based on recyclerlistview which was not designed in a way that makes it easy to maintain scroll position.
Our current work is split between these branches:

To summarise:

  • We are still working on adding the features to FlashList needed / fixing bugs to make it work well for expensify.
  • When we have all those changes ready we'd need to make a big patch for expensify + open upstream PRs
    • Given how slow the bi-directional support PR is coming along in FlashList its questionable how fast our changes will go upstream.
    • It might makes more sense to add the packages as custom modules to expensify and maintain from the code on our own (to be discussed)

Something else we'd like to discuss is trying out a new list library called legend-list. It supports maintainVisibleScrollPosition inherently, is JS only but said to be much better performing than FlatList.
It might be that his library as a "faster FlatList" alternative that already includes the features we need is a better bet than going down the road with our "custom FlashList fork". I will open a separate ticket for investigating this if you agree?

@mountiny
Copy link
Contributor

mountiny commented Jan 7, 2025

I will open a separate ticket for investigating this if you agree?

I think this is tricky as I bet there is many alternatives to explore. I think we should aim to look at the most popular and supported options.

Feel free to check it out and if its really promising, consider doing some MVP and posting a proposal, but lets try not to spend too much time on it

@melvin-bot melvin-bot bot added the Overdue label Feb 10, 2025
@garrettmknight
Copy link
Contributor

garrettmknight commented Feb 12, 2025

@hannojg @mountiny any thoughts on this one?

@melvin-bot melvin-bot bot removed the Overdue label Feb 12, 2025
@mountiny
Copy link
Contributor

@hannojg @janicduplessis can you please post another update? thanks!

@hannojg
Copy link
Contributor

hannojg commented Feb 18, 2025

We haven't progressed with that task yet. Janic unfortunately become unavailable for working on this.
I am currently trying to reschedule this task in our team!
Will keep you posted!

@mallenexpensify mallenexpensify changed the title HIGH: Migrate the main chat list to FlashList [HIGH] Migrate the main chat list to FlashList Feb 27, 2025
@mallenexpensify
Copy link
Contributor

Posted in #expert-contributors

We're looking for someone to take this on.
@vit @Hanno Gödecke
, any ideas who might be the best fit?

@mallenexpensify mallenexpensify added Weekly KSv2 and removed Monthly KSv2 labels Feb 27, 2025
@hannojg
Copy link
Contributor

hannojg commented Feb 27, 2025

We re-evaluated this ticket internally and think that it's probably not worth the effort.
FlashList isn't really build with bi-directional scrolling in mind and forcing it to do it will only gain mediocre result that wouldn't justify the high amount of time we'd need to invest.

We still want to work on making the chat list as fast as it can be. We want to build a few PoC (where we keep bidirectional scrolling in mind) and evaluate those. This will probably be a mix of:

  • Write our own implementation
  • Legend list
  • Other solutions we might come across

We might want to either:

  • close this ticket and open a new one
  • convert this ticket to be a general list performance investigation ticket

@mallenexpensify mallenexpensify changed the title [HIGH] Migrate the main chat list to FlashList [HOLD][HIGH] Migrate the main chat list to FlashList Feb 27, 2025
@mallenexpensify
Copy link
Contributor

Thanks for the update @hannojg , I put the issue on hold for now. There's no big rush, I'm just going through HIGH and CRITICAL issues on the #quality project to ensure we're properly aligned and prioritized.

@melvin-bot melvin-bot bot added the Overdue label Mar 7, 2025
@garrettmknight
Copy link
Contributor

Still on hold.

@melvin-bot melvin-bot bot removed the Overdue label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NewFeature Something to build that is a new item. Weekly KSv2
Projects
Status: HIGH
Development

No branches or pull requests

8 participants