perf: improve native apps startup#563
Conversation
chrispader
left a comment
There was a problem hiding this comment.
As @hannojg already suggested, we definitely want to preserve the ability to get the value from cache rather than from storage in Onyx.connect.
neil-marcellini
left a comment
There was a problem hiding this comment.
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.
chrispader
left a comment
There was a problem hiding this comment.
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 👍 |
mountiny
left a comment
There was a problem hiding this comment.
@hurali97 mainly comment changes requested.
@chrispader @hannojg can you give this another look please?
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
mountiny
left a comment
There was a problem hiding this comment.
Thanks! @neil-marcellini all yours
hoangzinh
left a comment
There was a problem hiding this comment.
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
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks really good, thank you.
mountiny
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectiontoggleReportand notonIconClick)myBool && <MyComponent />.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Avataris modified, I verified thatAvataris working as expected in all cases)mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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