[No QA] perf: avoid mapping all personal details in ReportWelcomeText#88511
Conversation
|
@abzokhattab 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] |
abzokhattab
left a comment
There was a problem hiding this comment.
the changes looks good to me
NAB: Minor issues i found that worth handling for consistency:
- the following test case name is now not correct ... lets remove the
via useMappedPersonalDetails - Same anti‑pattern still lives in
DebugReportActionswe can also handle it
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@abzokhattab thanks, done 👍 |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.62-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
ReportWelcomeTextpreviously calleduseMappedPersonalDetails(personalDetailMapper), which walks the entirePERSONAL_DETAILS_LISTand produces a projected copy of every personal detail on every render.The component only consumes personal details for a handful of participants (via
getPersonalDetailsForAccountIDs(participantAccountIDsExcludeCurrentUser, personalDetails)), which indexes by account ID — so the full mapping was wasted work.The fix swaps the mapped hook for raw
useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST). Re-render surface is unchanged (Onyx still uses shallowEqual on the raw collection), but per-render cost drops from ~270ms to a few key lookups.Before, on account with ~11k personal details and iOS, render time of
ReportWelcomeTextvaried from 50 to 500ms (depending on a report). Now it's stable ~2ms every time.Fixed Issues
$ #88516
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari