Skip to content
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-11-17] [Performance] ReportScreen loading times #29987

Closed
kacper-mikolajczak opened this issue Oct 19, 2023 · 25 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@kacper-mikolajczak
Copy link
Contributor

kacper-mikolajczak commented Oct 19, 2023

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?

Report screen suffers high loading times, especially with a growing amount of comments in a report.

What is the impact of this on end-users?

Report screen should load faster.

List any benchmarks that show the severity of the issue

report_screen_loading-ios-main-react

Proposed solution (if any)

Analysis

Each comment in ReportScreen is assembled of some components whose rendering times exceed expected values.

Suboptimal rendering times of those components stem from a "retrieval" of heavy personalDetails object from Onyx. This call is made for every item in the list, in two separate places (ReportActionItem and ReportActionItemSingle) thus when there are many items, the list loading time slows down a ton.

Solution

The idea is to cache those direct Onyx calls with a help of React context, by using the alternative of already established withPersonalDetails HOC, usePersonalDetails hook. This way, we would have only a single instance of personalDetails that every item can easily access, instead of triggering a new costly retrieval process.

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

report_screen_loading-ios-after-react

On iOS, HT account, the difference in render times of ReportActionsList component are as follows:
First render: ~2800ms vs ~560ms
Second render: ~615ms vs ~450ms
Third render: ~540ms vs ~360ms
The render count remains the same.

Recording:

report_screen_loading-ios-comparison.mov

Platforms:

Which of our officially supported platforms is this issue occurring on?
Probably all of them.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010cdf03125ac6d05d
  • Upwork Job ID: 1715142044114538496
  • Last Price Increase: 2023-10-19
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Triggered auto assignment to @thienlnam (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@kacper-mikolajczak
Copy link
Contributor Author

CC: @mountiny

@kacper-mikolajczak
Copy link
Contributor Author

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Oct 19, 2023
@melvin-bot melvin-bot bot changed the title [Performance] ReportScreen loading times [$500] [Performance] ReportScreen loading times Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Job added to Upwork: https://www.upwork.com/jobs/~010cdf03125ac6d05d

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

@mountiny mountiny changed the title [$500] [Performance] ReportScreen loading times [Performance] ReportScreen loading times Oct 19, 2023
@mountiny mountiny removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

📣 @eVoloshchak Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 20, 2023
@kacper-mikolajczak
Copy link
Contributor Author

Hi @eVoloshchak! PR is ready to be reviewed - let me know if you need any info on this one 👍

@eVoloshchak
Copy link
Contributor

@kacper-mikolajczak, reviewing now!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 25, 2023
@melvin-bot melvin-bot bot changed the title [Performance] ReportScreen loading times [HOLD for payment 2023-11-01] [Performance] ReportScreen loading times Oct 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.90-2 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-11-01. 🎊

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 Reviewing Has a PR in review Weekly KSv2 Daily KSv2 and removed Weekly KSv2 labels Oct 27, 2023
Copy link

melvin-bot bot commented Nov 8, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Nov 8, 2023

@eVoloshchak, @thienlnam, @kacper-mikolajczak Whoops! This issue is 2 days overdue. Let's get this updated quick!

@thienlnam
Copy link
Contributor

Looks like we don't have a BZ member assigned to handle payment here - adding the label

@thienlnam thienlnam added the NewFeature Something to build that is a new item. label Nov 9, 2023
Copy link

melvin-bot bot commented Nov 9, 2023

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 9, 2023
@thienlnam
Copy link
Contributor

We're ready for a payment for C+ review to @eVoloshchak

@eVoloshchak
Copy link
Contributor

Requested the $500 payment via NewDot

@eVoloshchak
Copy link
Contributor

Just realized there were 2 PRs, the second one hasn't been deployed to production yet
@thienlnam, are we treating them as two separate PR's or as one PR divided into two?
In both cases, we should probably wait for the 7-day regression period on the second PR, deleting the payment request I sent above

@sonialiap
Copy link
Contributor

The second PR deployed to prod on Nov 10, updating pay date to 17

@thienlnam bumping Eugene's question about how we're treating the PRs

@sonialiap sonialiap changed the title [HOLD for payment 2023-11-01] [Performance] ReportScreen loading times [HOLD for payment 2023-11-17] [Performance] ReportScreen loading times Nov 13, 2023
@sonialiap
Copy link
Contributor

@thienlnam why did we have two PRs? Did we miss something and needed to open a new one or did the scope grow? Asking to know if this should be billed as one review or two.

@kacper-mikolajczak
Copy link
Contributor Author

Hi @sonialiap! 👋 Looking at the diffs of these 2 PRs, it looks like there was more to be achieved with further improvements under the same scope (this issue). I would think of it as a continuation of the task that spanned into another PR.

Hope that helps! 👍

@thienlnam
Copy link
Contributor

Was OOO, but yeah let's just treat this as the one PR divided into 2 and use the latest PR for the payment date

@eVoloshchak
Copy link
Contributor

Requested the payment!

@JmillsExpensify
Copy link

This issue lacks a payment summary.

@sonialiap
Copy link
Contributor

Payment summary:

@JmillsExpensify
Copy link

$500 payment approved for @eVoloshchak based on summary above.

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 Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
Development

No branches or pull requests

6 participants