-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA] Improve isEmptyReport performance #45750
[No QA] Improve isEmptyReport performance #45750
Conversation
@arosiclair Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@rinej @adhorodyski is there an issue or an internal engineer working with you for this? |
@arosiclair we're coming from https://expensify.slack.com/archives/C05LX9D6E07/p1721060786438019 where we conduct these improvements with @muttmuure @mountiny @neil-marcellini |
Thanks for the link. Be sure to link to our slack in the PR description since your internal slack is not accessible for us and I had no clue where this change was coming from 😅 . It also would've been good to have an issue opened to track all of those PRs and add context. This one is very simple so I'll just go ahead and merge the change. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@arosiclair got you, totally understand - I can see it pointing poorly 😅 Thank you for moving with this so quickly! I'll make sure we also have a container issue for these items:) |
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.0.10-2 🚀
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.0.10-3 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.10-7 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.11-5 🚀
|
Details
Because
getLastVisibleMessage
is quite expensive operation and MOST of the Reports are not empty we want to avoid running that function inisEmptyReport
, by adding the early return statement the method will not be called everytime theisEmptyReport
is calledTraces before fix:
Trace with fix:
Please note that the above results are not guaranteed to occur in every instance. The
getLastVisibleMessage
function will not be called only when we have reports indicating that the first two conditions have been fulfilled. In such cases, we will experience the gain.Fixed Issues
$
PROPOSAL: https://callstack-hq.slack.com/archives/C05LX9D6E07/p1721060786438019
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop