Skip to content

[HOLD for payment 2023-10-02] Memoize expensive calls in ReportActionsList renderItem #27972

Closed

Description

@mountiny

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 component ReportActionsListItemRenderer which will prevent any re-renders coming from from FlatList for items that were already rendered. This reduces the number of calls to isConsecutiveActionMadeByPreviousActor 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).

Activity

  1. self-assigned this
    on Sep 22, 2023
  2. added
    Reviewing
    on Sep 25, 2023
  3. mountiny commented on Sep 25, 2023

    @mountiny
    ContributorAuthor

    merged

  4. added
    Bug
    on Sep 25, 2023
  5. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  6. melvin-bot commented on Sep 25, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. added
    Weekly
    Awaiting Payment
    and removed
    Daily
    on Sep 25, 2023
  8. 7 remaining items

  9. mollfpr commented on Oct 3, 2023

    @mollfpr
    Contributor

    @mountiny @sonialiap I think there's nothing we can add to the BZ checklist.

  10. mountiny commented on Oct 3, 2023

    @mountiny
    ContributorAuthor

    I agree, no need here for the checklist

  11. mollfpr commented on Oct 6, 2023

    @mollfpr
    Contributor

    @sonialiap I think I can request payment in NewDot for this issue.

  12. JmillsExpensify commented on Oct 6, 2023

    @JmillsExpensify
    Contributor

    @sonialiap Can you please add a payment summary to this issue so I can pay?

  13. melvin-bot commented on Oct 9, 2023

    @melvin-bot

    @sonialiap, @mollfpr, @mountiny Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  14. sonialiap commented on Oct 9, 2023

    @sonialiap
    Contributor

    Sorry for the delay, working 50% while trying to juggle the normal work load.

    Payment:

  15. JmillsExpensify commented on Oct 9, 2023

    @JmillsExpensify
    Contributor

    $750 payment approved for @mollfpr based on BZ summary.

  16. mollfpr commented on Oct 15, 2023

    @mollfpr
    Contributor

    @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!

  17. mollfpr commented on Oct 20, 2023

    @mollfpr
    Contributor

    Friendly bump @JmillsExpensify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyTask

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions