Coming from Slack
Background:
Currently, personal Expensify cards are stored under ONYXKEYS.CARD_LIST, while workspace-issued cards are stored under ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST. Multiple components independently subscribe to both stores and locally merge the two datasets using mergeCardListWithWorkspaceFeeds, often applying slightly different filtering logic. These components mount frequently, while the underlying card data changes relatively infrequently.
Problem:
When users open reports that contain many personal and workspace cards, then report views take noticeably longer to load, degrading the perceived performance of core reporting workflows.
Solution:
Introduce a derived Onyx value, ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST, which depends on CARD_LIST and WORKSPACE_CARDS_LIST. This derived value filters out personal cards and merges both sources once within the Onyx engine, recomputing only when one of the underlying keys changes. Components subscribe to the derived value instead of performing local merges, eliminating redundant per-mount computations.
Results:
On heavy account there is +40k cards in workspace list.
- Open report from Reports Tab, Expenses section. Time reduced from 750ms to 560 ms (25%)
- Number or mergeCardListWithWorkspaceFeeds calls reduced from 29 to 0
- Restart app (on Reports Tab, Expenses section) Time reduced from 3850 ms to 3630 ms (5,7%)
- Number or mergeCardListWithWorkspaceFeeds calls reduced from 49 to 9.
- Open report from Reports Tab, Reports section. Time reduced from 775ms to 600 ms (22%)
- Time spent on useCardFeedsForDisplay reduced from 260ms to 0.1ms (stable derived reference, openReport action)
Even with a few cards, it provides a more stable reference, which should result in fewer rerenders for other components.
Draft PR: #79347
Part of #77173 effort
Issue Owner
Current Issue Owner: @stephanieelliott
Issue Owner
Current Issue Owner: @LukasMod
Coming from Slack
Background:
Currently, personal Expensify cards are stored under ONYXKEYS.CARD_LIST, while workspace-issued cards are stored under ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST. Multiple components independently subscribe to both stores and locally merge the two datasets using mergeCardListWithWorkspaceFeeds, often applying slightly different filtering logic. These components mount frequently, while the underlying card data changes relatively infrequently.
Problem:
When users open reports that contain many personal and workspace cards, then report views take noticeably longer to load, degrading the perceived performance of core reporting workflows.
Solution:
Introduce a derived Onyx value, ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST, which depends on CARD_LIST and WORKSPACE_CARDS_LIST. This derived value filters out personal cards and merges both sources once within the Onyx engine, recomputing only when one of the underlying keys changes. Components subscribe to the derived value instead of performing local merges, eliminating redundant per-mount computations.
Results:
On heavy account there is +40k cards in workspace list.
Even with a few cards, it provides a more stable reference, which should result in fewer rerenders for other components.
Draft PR: #79347
Part of #77173 effort
Issue Owner
Current Issue Owner: @stephanieelliottIssue Owner
Current Issue Owner: @LukasMod