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 2024-07-10] [HOLD for payment 2024-07-02] [$250] [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection #41895

Closed
mountiny opened this issue May 9, 2024 · 36 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@mountiny
Copy link
Contributor

mountiny commented May 9, 2024

Slack here

Problem

We have many calls to keysChanged function throughout the session and on an average it will be around ~800 ms. That’s a lot for a function which is called this many times. From the trace, this function is called roughly around 15 times.

Inside of this function we have getCachedCollection , which first calls Array.from on the Set then filter it out and then reduce the returned value.

Solution

We can improve this by doing only 1 loop directly on Set as it gives us forEach.

cc @hurali97

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0145b3587af847aed1
  • Upwork Job ID: 1804230619308310738
  • Last Price Increase: 2024-06-21
Issue OwnerCurrent Issue Owner: @puneetlath
@mountiny mountiny added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 9, 2024
@mountiny mountiny self-assigned this May 9, 2024
Copy link

melvin-bot bot commented May 9, 2024

Triggered auto assignment to @puneetlath (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@hurali97
Copy link
Contributor

hurali97 commented May 9, 2024

@mountiny Please assign this to me 👋

@marcaaron marcaaron self-assigned this May 10, 2024
@quinthar quinthar changed the title [Performance] Improve the performance of getCachedCollection LOW: [Performance] Improve the performance of getCachedCollection May 12, 2024
@melvin-bot melvin-bot bot added the Overdue label May 12, 2024
@mountiny
Copy link
Contributor Author

@mountiny
Copy link
Contributor Author

PR has gone through Applause testing. @ikevin127 volunteered to help triaging the found bugs and so we identify what are real bugs stemming from the onyx bump quicker

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 15, 2024
@ikevin127

This comment was marked as outdated.

@melvin-bot melvin-bot bot removed the Overdue label May 17, 2024
@ikevin127

This comment was marked as outdated.

@ikevin127
Copy link
Contributor

✅ Triaged all the reported PR issues and summarized in #42057 (comment).
cc @mountiny

@mountiny
Copy link
Contributor Author

Thanks, very helpful!

Copy link

melvin-bot bot commented May 23, 2024

@puneetlath @marcaaron @mountiny @hurali97 @ikevin127 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label May 23, 2024
@mountiny mountiny added the Reviewing Has a PR in review label May 23, 2024
@melvin-bot melvin-bot bot removed the Overdue label May 23, 2024
@mountiny
Copy link
Contributor Author

Merged 🎉

@melvin-bot melvin-bot bot removed the Daily KSv2 label May 28, 2024
@ikevin127

This comment was marked as outdated.

@mountiny
Copy link
Contributor Author

This was a large PR and big effort, with multiple Onyx PRs and multiple rounds of testing of the App PR

I suggest $1000 to @ikevin127 for their exemplary work on the onyx bump, testing, reviewing and bringing clarity into regressions raised from Applause helping Chris to get this PR over the finish line soon.

$250 to @s77rt since they have entered this task at later phase, also very helpful though

@mountiny mountiny changed the title LOW: [Performance] Improve the performance of getCachedCollection [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection Jun 19, 2024
@mountiny mountiny added the Awaiting Payment Auto-added when associated PR is deployed to production label Jun 19, 2024
@mountiny
Copy link
Contributor Author

I think @puneetlath is assigned as BZ here, let me know if not. Thanks!

@ikevin127

This comment was marked as resolved.

@mallenexpensify mallenexpensify added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed Weekly KSv2 labels Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0145b3587af847aed1

@melvin-bot melvin-bot bot changed the title [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection [$250] [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection Jun 21, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

Current assignees @s77rt and @ikevin127 are eligible for the External assigner, not assigning anyone new.

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Jun 21, 2024

@ikevin127 can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~0145b3587af847aed1

@mallenexpensify
Copy link
Contributor

Contributor: @ikevin127 paid $1000 via Upwork (per @mountiny 's comment above)
Contributor+: @s77rt due $250 via NewDot (also in Vit's comment)

Doesn't look like this needs a regression test, comment/reopen if anyone disagrees.

@JmillsExpensify
Copy link

$250 approved for @s77rt

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jun 25, 2024
@melvin-bot melvin-bot bot changed the title [$250] [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection [HOLD for payment 2024-07-02] [$250] [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.1-19 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 2024-07-02. 🎊

For reference, here are some details about the assignees on this issue:

  • @s77rt requires payment (Needs manual offer from BZ)
  • @hurali97 does not require payment (Contractor)
  • @ikevin127 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Jun 25, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@s77rt / @ikevin127] The PR that introduced the bug has been identified. Link to the PR:
  • [@s77rt / @ikevin127] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@s77rt / @ikevin127] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@s77rt / @ikevin127] Determine if we should create a regression test for this bug.
  • [@s77rt / @ikevin127] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@s77rt
Copy link
Contributor

s77rt commented Jun 27, 2024

Checklist ^ does not apply here. Not a bug

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-02] [$250] [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection [HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [$250] [HOLD for Payment 2024-06-21] LOW: [Performance] Improve the performance of getCachedCollection Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 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 2024-07-10. 🎊

For reference, here are some details about the assignees on this issue:

  • @s77rt requires payment through NewDot Manual Requests
  • @hurali97 does not require payment (Contractor)
  • @ikevin127 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Jul 3, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@s77rt / @ikevin127] The PR that introduced the bug has been identified. Link to the PR:
  • [@s77rt / @ikevin127] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@s77rt / @ikevin127] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@s77rt / @ikevin127] Determine if we should create a regression test for this bug.
  • [@s77rt / @ikevin127] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

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. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
Development

No branches or pull requests

8 participants