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-02] [Performance] Optimize setting initial state in functional components #30209

Closed
6 tasks done
sebryu opened this issue Oct 23, 2023 · 6 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering Weekly KSv2

Comments

@sebryu
Copy link
Contributor

sebryu commented Oct 23, 2023

What performance issue do we need to solve?

Setting initial state in functional components in a way that is running calculation only once

What is the impact of this on end-users?

Slightly more loading time/memory usage of multiple components (e.g parsing HTML multiple times)

List any benchmarks that show the severity of the issue

Gains may be minor, but new approach is following best practices (also discussed on slack with Expensify team )

Proposed solution (if any)

Using initializer function to useState calls. That will ensure calculations are run only once.

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

It's not optimal to collect those benchmark in this case.

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Version Number:
Reproducible in staging?:
Reproducible in production?:
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:

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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

@sebryu
Copy link
Contributor Author

sebryu commented Oct 23, 2023

Issue created for tracking purposes.
PR already open for review (proposal approved by engineers on slack) : #29630

@mountiny
Copy link
Contributor

Adding this to the performance project and assigning myself

@mountiny mountiny moved this to MEDIUM in [#whatsnext] #quality Oct 24, 2023
@mountiny
Copy link
Contributor

PR merged! thanks @sebryu

@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 26, 2023
@melvin-bot melvin-bot bot changed the title [Performance] Optimize setting initial state in functional components [HOLD for payment 2023-11-02] [Performance] Optimize setting initial state in functional components Oct 26, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2023

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

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

@github-project-automation github-project-automation bot moved this from MEDIUM to Done in [#whatsnext] #quality Oct 28, 2023
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 Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

3 participants