-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 for payment 2023-10-02] Memoize expensive calls in ReportActionsList renderItem #27972
Comments
merged |
Triggered auto assignment to @sonialiap ( |
Bug0 Triage Checklist (Main S/O)
|
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-02. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@mountiny @sonialiap I think there's nothing we can add to the BZ checklist. |
I agree, no need here for the checklist |
@sonialiap I think I can request payment in NewDot for this issue. |
@sonialiap Can you please add a payment summary to this issue so I can pay? |
@sonialiap, @mollfpr, @mountiny Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Sorry for the delay, working 50% while trying to juggle the normal work load. Payment:
|
$750 payment approved for @mollfpr based on BZ summary. |
@sonialiap @JmillsExpensify Sorry to open this up. I just noticed that the request on the ND I did was requested and approved for $500, so there's there is a shortage in payment here. Could you help confirm it? Thank you! |
Friendly bump @JmillsExpensify |
Problem
Some of the operations we do in ReportActionsList renderItem are pretty expensive since this function is executed for every items in the render window every time the render window changes. To improve performance of FlatList scrolling we need to move any expensive computation inside a memoized component. This way when FlatList re-renders to display new items but the data did not change only the new rendered items will need to render.
We were already memoizing ReportActionItem, but renderItem still contains some expensive calls, specifically
isConsecutiveActionMadeByPreviousActor
which has to do some date comparisons. I moved those to a new componentReportActionsListItemRenderer
which will prevent any re-renders coming from from FlatList for items that were already rendered. This reduces the number of calls toisConsecutiveActionMadeByPreviousActor
from the number of currently rendered item (~100 depending on the FlatList window size) to just the new items being added (usually 10 since this is the batch size).The text was updated successfully, but these errors were encountered: