Skip to content

[HOLD for payment 2023-10-02] [HOLD] [Performance] ReportScreen unnecessary re-renders #15163

Closed

Description

@mountiny

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


What performance issue do we need to solve?

Right now, every time a report action updates the whole <ReportActionsList /> will re-render. None of the items that get rendered are memoized. This means that on a single update (e.g. adding a reaction/editing the text) all mounted views of the list will need to re-render.

Lets investigate the ReportScreen component tree too as its quite render heavy

What is the impact of this on end-users?

Re-rendering components when its contents haven't changed will in general slow down the app for no good reason

List any benchmarks that show the severity of the issue

None yet

Proposed solution (if any)

  1. Memoize the - For this approach it would be good to have a version number for each report action, so we can quickly compare if we need to re-render it
  2. Only pass an array of string ids to , which represents the order of report actions. Then, just receives a string, and connects to onyx to get updates for the action from the store. This way when an update to a report happens (such as an added reaction), only the instance of has to re-render instead of the whole list
    This approach might even be faster than the first option, as on an update not all items have to run their arePropsEqual function.

List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)

None yet

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.2.71-1
Reproducible in staging?: yes
Reproducible in production?: yes
Email or phone of affected tester (no customers): N/A
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL: here
Issue reported by: @hannojg
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1675076963206029

View all open jobs on Upwork

Activity

  1. self-assigned this
    on Feb 15, 2023
  2. locked and limited conversation to collaborators on Feb 15, 2023
  3. unlocked this conversation on Feb 15, 2023
  4. removed their assignment
    on Feb 15, 2023
  5. added
    Weekly
    and removed
    Daily
    on Feb 15, 2023
  6. hannojg commented on Feb 15, 2023

    @hannojg
    Contributor

    Please assign me for this one 👼

  7. added and removed
    Weekly
    on Mar 10, 2023
  8. MelvinBot commented on Mar 10, 2023

    @MelvinBot
    Contributor

    This issue has not been updated in over 15 days. eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  9. added
    Weekly
    and removed on Mar 10, 2023
  10. 99 remaining items

  11. melvin-bot commented on Oct 4, 2023

    @melvin-bot

    @janicduplessis, @hannojg, @mountiny Whoops! This issue is 2 days overdue. Let's get this updated quick!

  12. added
    Bug
    on Oct 4, 2023
  13. melvin-bot commented on Oct 4, 2023

    @melvin-bot

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

  14. melvin-bot commented on Oct 4, 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
  15. mountiny commented on Oct 4, 2023

    @mountiny
    ContributorAuthor

    Hello @isabelastisser Can you please pay $500 to @sobitneupane for review and testing of this PR? Thanks!

  16. sobitneupane commented on Oct 9, 2023

    @sobitneupane
    Contributor

    #15163 (comment)

    Requested payment on newDot

  17. mountiny commented on Oct 9, 2023

    @mountiny
    ContributorAuthor

    Thanks then we can close this one

  18. JmillsExpensify commented on Oct 9, 2023

    @JmillsExpensify
    Contributor

    $500 payment approved for @sobitneupane based on this comment.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions