Call to shortAbsoluteDate in particular takes surprisingly long (like 5ms each time and it's re-rendering like 5 times and there are 5 instances so 5*5*5ms = 125ms total when doing the "navigate to thread w/ varun scenario").
Details
Details
- Reviewers
ginsu tomek rohan - Commits
- rCOMM3eae57836282: [native] Add memoization to `SidebarItem`
Continues to work/appear as before.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Please wait for CI to pass before landing
native/chat/sidebar-item.react.js | ||
---|---|---|
19–22 ↗ | (On Diff #30847) | Doing a global search on this I've noticed that this pattern is repeated a few times. As a follow up diff, should we make shortAbsoluteDate into a hook (maybe like useShortAbsoluteDate) so that we can use useMemo in the hook and simplify this call here and in other places? |
native/chat/sidebar-item.react.js | ||
---|---|---|
19–22 ↗ | (On Diff #30847) | Yeah I'll jot down that we should look at all shortAbsoluteDate callsites. There's other low-hanging fruit so I'll probably prioritize that first. |