[NoQA] Reduce memory allocation during derived values calculations - #96320
Conversation
|
🚧 puneetlath has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
No product review needed. |
|
@eh2077 kind bump here! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-07-20.at.8.52.20.PM.mov |
eh2077
left a comment
There was a problem hiding this comment.
looks good! Refactoring doesn't change functionality.
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.42-0 🚀
|
Help site review: no changes requiredI reviewed the changes in this PR and no updates are needed to the help site files under This is a purely internal performance refactor of the OnyxDerived compute functions — it swaps Since there's nothing customer-facing to document, I have not created a draft PR. @VickyStash, if you believe a user-facing behavior did change and warrants a docs update, let me know and I'll draft one. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.42-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Replaces
Object.entriesiteration withObject.keysacross the OnyxDerived config compute functions to avoid allocating a [key, value] tuple array per entry, and drops the{cardList, ...rest}object spread incardFeedErrorsin favor of iterating cards in place viaforEachAssignedCard. Also collapses a.filter().map()chain into a single loop, cutting intermediate array allocations on these hot, frequently-recomputed derived values.Fixed Issues
$ #93916
PROPOSAL: N/A
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.