Skip to content

[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

Description

@mountiny

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 9, 2024
  2. self-assigned this
    on May 9, 2024
  3. melvin-bot commented on May 9, 2024

    @melvin-bot

    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.

  4. hurali97 commented on May 9, 2024

    @hurali97
    Contributor

    @mountiny Please assign this to me 👋

  5. self-assigned this
    on May 10, 2024
  6. changed the title [-][Performance] Improve the performance of getCachedCollection[/-] [+]LOW: [Performance] Improve the performance of getCachedCollection[/+] on May 12, 2024
  7. mountiny commented on May 13, 2024

    @mountiny
    ContributorAuthor
  8. 55 remaining items

  9. mallenexpensify commented on Jun 21, 2024

    @mallenexpensify
    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.

  10. JmillsExpensify commented on Jun 22, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @s77rt

  11. 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[/+] on Jun 25, 2024
  12. melvin-bot commented on Jun 25, 2024

    @melvin-bot

    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)
  13. melvin-bot commented on Jun 25, 2024

    @melvin-bot

    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:
  14. s77rt commented on Jun 27, 2024

    @s77rt
    Member

    Checklist ^ does not apply here. Not a bug

  15. 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[/+] on Jul 3, 2024
  16. melvin-bot commented on Jul 3, 2024

    @melvin-bot

    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)
  17. melvin-bot commented on Jul 3, 2024

    @melvin-bot

    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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions