-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Comments
Triggered auto assignment to @youssef-lr ( |
Issue created for tracking purposes. |
Adding this to the performance project and assigning myself |
PR merged! thanks @sebryu |
|
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.
|
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?
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:
The text was updated successfully, but these errors were encountered: