Skip to content

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

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

Closed
6 tasks done
mountiny opened this issue Feb 15, 2023 · 52 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@mountiny
Copy link
Contributor

mountiny commented Feb 15, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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

@mountiny mountiny self-assigned this Feb 15, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Feb 15, 2023
@Expensify Expensify unlocked this conversation Feb 15, 2023
@mountiny mountiny removed their assignment Feb 15, 2023
@mountiny mountiny added Weekly KSv2 and removed Daily KSv2 labels Feb 15, 2023
@hannojg
Copy link
Contributor

hannojg commented Feb 15, 2023

Please assign me for this one 👼

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Mar 10, 2023
@MelvinBot
Copy link

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!

@mountiny mountiny added Weekly KSv2 and removed Monthly KSv2 labels Mar 10, 2023
@mountiny
Copy link
Contributor Author

I think this might one of @hannojg priorities once the Reactions go through some polish

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Apr 3, 2023
@MelvinBot
Copy link

This issue has not been updated in over 15 days. @hannojg 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!

@mountiny
Copy link
Contributor Author

mountiny commented Apr 3, 2023

@hannojg How is this looking with your other projects? Reactions are almost done

@mountiny mountiny changed the title [Performance] ReportActionsList unnecessary re-renders [Performance] ReportScreen unnecessary re-renders May 10, 2023
@melvin-bot melvin-bot bot added the Overdue label May 10, 2023
@mountiny mountiny added Daily KSv2 and removed Monthly KSv2 labels May 10, 2023
@melvin-bot melvin-bot bot removed the Overdue label May 10, 2023
@mountiny
Copy link
Contributor Author

bumping this to Daily to make sure we investigate this as we are making this component even more robust with manual request so achieving great performance is important

@hannojg
Copy link
Contributor

hannojg commented May 10, 2023

@mountiny I will pass this task on to @janicduplessis , while I will investigate the performance of other flows in the app.
Please assign him, the issue is in good hands with him 😊

@janicduplessis Despite the title of the issue the goal here is to make the ReportScreen work just fast.

@mountiny
Copy link
Contributor Author

@janicduplessis Can you please comment on this issue so I can assign you? thank you!

@janicduplessis
Copy link
Contributor

Sounds good!

@melvin-bot melvin-bot bot added the Weekly KSv2 label Sep 19, 2023
@janicduplessis
Copy link
Contributor

Updated #19345 to only include virtualized list batch size change.

@mountiny
Copy link
Contributor Author

@janicduplessis to confirm, that does not need to be on hold for the RNW update, right?

@janicduplessis
Copy link
Contributor

It still does, that was the one fix that needed the RNW update. If we want we could apply the fix only for native if we want to avoid the hold on RNW update.

@mountiny
Copy link
Contributor Author

Thanks for confirming, now I remember the sidebarData. Thanks!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title [HOLD] [Performance] ReportScreen unnecessary re-renders [HOLD for payment 2023-10-02] [HOLD] [Performance] ReportScreen unnecessary re-renders Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

@mountiny mountiny added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

@mountiny
Copy link
Contributor Author

mountiny commented Oct 4, 2023

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

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 4, 2023
@sobitneupane
Copy link
Contributor

#15163 (comment)

Requested payment on newDot

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2023
@mountiny
Copy link
Contributor Author

mountiny commented Oct 9, 2023

Thanks then we can close this one

@mountiny mountiny closed this as completed Oct 9, 2023
@github-project-automation github-project-automation bot moved this from HIGH to Done in [#whatsnext] #quality Oct 9, 2023
@JmillsExpensify
Copy link

$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
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
Status: Done
Development

No branches or pull requests

7 participants