-
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-07-21] [Performance] Reduce re-renders of ReportScreen
when re-opening/switching it
#21831
Comments
Triggered auto assignment to @MariaHCD ( |
I don't believe I need to be assigned to this :) |
@hannojg Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Handling the PR review so assigning to myself |
ReportScreen
when re-opening/switching itReportScreen
when re-opening/switching it
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.40-5 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-07-21. 🎊 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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
What performance issue do we need to solve?
We want to optimise the performance when switching the chat/report screen.
What is the impact of this on end-users?
Improved TTI when opening another report.
List any benchmarks that show the severity of the issue
When using the react-devtools profiler we can track the commits react does. When opening a report screen, we can see that there is this is, after the
ReportScreen
has already been rendered another render. This render is due to the fact that a state variable calledskeletonViewContainerHeight
got changed:In the current code-design we do need to measure that height once, however, this doesn't need to cause a re-render when we are switching the chat screen.
Proposed solution (if any)
We are already storing the skeleton height globally to reuse it, all we need to do is stop the setState call.
Here, we store and reuse the height value:
App/src/pages/home/ReportScreen.js
Lines 120 to 134 in ecfcd83
Now, all we need to do is to stop the
setState
call here, which could look like this:(Note: another solution would be to turn the
ReportScreen
into aPureComponent
, however, this if check is should be cheaper then aPureComponent
)List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)
When measuring with the profiler again, we can see that the additional render of the
ReportScreen
is gone (note: only true when opening theReportScreen
for the second time):Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: latest/main
Reproducible in staging?: yes
Reproducible in production?: yes
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:
View all open jobs on Upwork
The text was updated successfully, but these errors were encountered: