-
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
[Performance] withOnyx
initial state from cache
#4592
Comments
Triggered auto assignment to @TomatoToaster ( |
cc @marcaaron |
Looks like the Regardless, I think we can try to pre-fill the state from the cache and then connect to anything that did not return a value. |
Hey I know some of the performance upgrade related work is its own project. Is this issue just for tracking? Or should I tag this as External so an upwork listing can be created? |
It's a conversation for now. This should probably have a |
Tested out my theory on an Android release build and startup time got worse 😄 I'm done for today... Just confirms my feeling the web profiler can't always be trusted. |
Actually thanks to your input I don't think we should call Do we really want to trigger a re-render (using Here's a rough proposal
In summary |
This is a valid point - a child can only mount when the parent is done Thought it's likely the same thing would happen if the Children themselves don't render anything because they lack the data... As to how to supply the data to the children instantly, yes one way would be to capture everything needed in the parent. Another would be to pre populate cache |
I like the former idea since it means we do not need to yet look into managing |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Overview
We can resolve initial component state from cache instead of starting with empty and the receive a burst of updates
Related to #4101
What performance issue do we need to solve?
What is the impact of this on end-users?
List any benchmarks that show the severity of the issue
renderApplication
See the `sendDataToConnection` calls that make the majority of the long running Task We should see a reduction in the amount of time they take
Profile data (you can load this in Chrome/Performance): https://u.pcloud.link/publink/show?code=XZCiqwXZco50EdMOjDXI1D8DhgzxGmPMTSV7
Proposed solution (if any)
Import the
cache
service inwithOnyx
Use cache and
mapOnyxToState
to try and map initial state from cacheIf we've mapped everything from cache we can set
loading: false
and render the wrapped componentLeave the existing logic that would call
setState
with values from storageList any benchmarks after implementing the changes to show impacts of the proposed solution (if any)
Note: These should be the same as the benchmarks collected before any changes.
Platform:
Where is this issue occurring?
Version Number: 1.0.85-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
View all open jobs on Upwork
The text was updated successfully, but these errors were encountered: