Skip to content

[HOLD for payment 2023-12-29] [HOLD for payment 2023-11-13] [$500] Optimize SearchPage component to reduce lags when opening #30261

Closed

Description

@mountiny

Coming from here

Proposal: Optimize SearchPage component to reduce lags when opening

Problem: When opening the SearchPage component using search icon or cmd+k shortcut on web, the animation is pretty laggy. This is caused mostly by OptionsListUtils.getSearchOptions which takes all reports as a param and at some point it processes it by looping through all the elements. For an account with ~15k reports, this loop takes up to 500ms. What’s worth noticing, OptionsListUtils.getSearchOptions is called directly in SearchPage constructor, and it’s responsible for retrieving the data that gets set as an initial state values.

Solution: To prevent doing heavy calculations on the same time as transitioning, we should remove calling getSearchOptions from constructor and set default values to empty objects. Instead, we can load this data right after transition ends by using onEntryTransitionEnd prop in ScreenWrapper. With this solution, animation will be smooth and user will be presented with the skeleton unless the data is processed. In my measurements, it reduced the time for initial render of SearchPage from ~1400ms to ~76ms. While profiling, JS Heap went down from 435-840mb range to 90-450mb.

cc @TMisiukiewicz

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017fbfc71ea6da3266
  • Upwork Job ID: 1716834699820085248
  • Last Price Increase: 2023-10-24

Activity

  1. added
    External
    Daily
    Bug
    on Oct 24, 2023
  2. changed the title [-]Optimize SearchPage component to reduce lags when opening[/-] [+][$500] Optimize SearchPage component to reduce lags when opening[/+] on Oct 24, 2023
  3. melvin-bot commented on Oct 24, 2023

    @melvin-bot
  4. added
    Help Wanted
    on Oct 24, 2023
  5. melvin-bot commented on Oct 24, 2023

    @melvin-bot

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

  6. deleted a comment from melvin-bot on Oct 24, 2023
  7. deleted a comment from melvin-bot on Oct 24, 2023
  8. mountiny commented on Oct 24, 2023

    @mountiny
    ContributorAuthor

    Sorry @laurenreidexpensify matt is ooo now

  9. 30 remaining items

  10. mountiny commented on Nov 20, 2023

    @mountiny
    ContributorAuthor

    Not needed, closing

  11. added
    Reviewing
    Weekly
    and removed
    Daily
    Weekly
    on Dec 21, 2023
  12. changed the title [-][HOLD for payment 2023-11-13] [$500] Optimize SearchPage component to reduce lags when opening[/-] [+][HOLD for payment 2023-12-29] [HOLD for payment 2023-11-13] [$500] Optimize SearchPage component to reduce lags when opening[/+] on Dec 22, 2023
  13. removed
    Reviewing
    on Dec 22, 2023
  14. melvin-bot commented on Dec 22, 2023

    @melvin-bot

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

  15. melvin-bot commented on Dec 22, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.15-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-12-29. 🎊

    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:

  16. melvin-bot commented on Dec 22, 2023

    @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:

    • [@mountiny] The PR that introduced the bug has been identified. Link to the PR:
    • [@mountiny] 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:
    • [@mountiny] 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:
    • [@TMisiukiewicz / @robertKozik] Determine if we should create a regression test for this bug.
    • [@TMisiukiewicz / @robertKozik] 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.
    • [@muttmuure] 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 PaymentBugExternalWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions