-
Notifications
You must be signed in to change notification settings - Fork 74
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
perf: improve native apps startup #563
perf: improve native apps startup #563
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @hannojg already suggested, we definitely want to preserve the ability to get the value from cache rather than from storage in Onyx.connect
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall. I think we can re-use some existing code.
I'm also curious if the for in loops are really helping performance / memory use or if that was just a preference. Disabling eslint is probably fine because I don't think we'll have prototype properties getting in the way, but let's only disable the rule if there's a good reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for the changes that were already mentioned
Comparing the before and after profiles, we get 400ms of reduction if we use |
@chrispader @hannojg suggested changes are addressed, would be great to if you guys can re-review 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hurali97 mainly comment changes requested.
@chrispader @hannojg can you give this another look please?
Co-authored-by: Vit Horacek <[email protected]>
Co-authored-by: Vit Horacek <[email protected]>
Co-authored-by: Vit Horacek <[email protected]>
Co-authored-by: Vit Horacek <[email protected]>
Co-authored-by: Vit Horacek <[email protected]>
Co-authored-by: Vit Horacek <[email protected]>
Co-authored-by: Vit Horacek <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! @neil-marcellini all yours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested well
Screenshots/Videos
Web
Screen.Recording.2024-06-26.at.01.46.51.mp4
IOS
Screen.Recording.2024-06-26.at.01.56.28.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good, thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets get this one going thank you very much!
🚀Published to npm in v2.0.54 |
Details
The changes in the PR are part of improving the app startup which was profiled for the native Apps. The main change is explained below, the other changes are self explanatory.
Prior to the following change, we had 2.4 seconds being consumed in the loop. We can improve this by doing a `multiGet` and then doing a loop over returned keys. This reduces the execution time to 250 ms, saving us 2 seconds.
Before:
After:
Related Issues
Expensify/App#43746
Automated Tests
Manual Tests
Author Checklist
### Related Issues
section aboveTests
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-web.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov