Repository navigation
[Perf] Restore React Compiler caching in useReportActionsPagination - #105781
roryabraham merged 2 commits into
Conversation
|
Span durations, control (main) vs fix (this change):
Setup: iOS 26 simulator (iPhone 17 Pro), standalone NewDot dev build, both legs on Expensify/App main ab0251e and differing only in JS, self DM. Legs alternate in ABBA blocks over 12 app relaunches, with a warm-up round after each relaunch discarded. Drift-adjusted deltas match the raw deltas. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@cretadn22 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] |
roryabraham
left a comment
There was a problem hiding this comment.
I think we can forego C+ review here
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 roryabraham 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.31-0 🚀
|
|
No help site update needed — this PR restores internal caching to improve chat performance without changing user workflows or making existing help instructions incorrect. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
useReportActionsPaginationfiltered the report actions before two hook calls and used the result after them. React Compiler cannot cache a value whose lifetime spans a hook call, so since #104522 removed theuseMemohere, the hook filtered the whole action list on every render and returned new arrays and a new result object. The report actions list then got new data on every render and re-rendered every visible row.This change calls all hooks first and computes the filtered actions after the last one.
useTransactionThreadstill gets the filtered list, as an inline argument the compiler can cache. The Concierge check is also computed after the last hook, because keeping it above the hooks breaks the cache again. The compiled hook goes from 7 cache slots with no guard around the action lists to 49 slots with every list and the returned object cached.On an iOS simulator dev build this brings ManualOpenReport from about 1700 ms to about 800 ms, and lowers ManualSendMessageVisible and ManualSendMessagePostCommit by about 105 to 115 ms.
Fixed Issues
$ #105792
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
Nagranie.z.ekranu.2026-11-3.o.17.58.45.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-11-3.o.17.57.23.mov