HomePhabricator
Diffusion Comm 8d3568785056

[native] Add some memoization to `UnreadDot`

Description

[native] Add some memoization to UnreadDot

Summary: Based on profiling, rendering UnreadDot takes ~0.8ms. That alone is pretty insignificant but multipled by 5 re-renders (in the "navigate to thread w/ varun scenario) and 29 instances of UnreadDot that adds up to ~116ms. Still not a lot, but pretty low effort to add memoization.

Test Plan:
Continues to look as expected. Will do before/after profiling screenshot at end of the stack (Setting up profiler and doing multiple runs can be kind of slow/require restarting metro/etc/etc.) showing before/after.

UnreadDot not re-rendering when ChatThreadList re-renders:

911478.png (502×390 px, 26 KB)

Reviewers: ginsu, rohan, tomek

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D9070

Details

Provenance
atulAuthored on Sep 6 2023, 1:26 PM
Reviewer
tomek
Differential Revision
D9070: [native] Add some memoization to `UnreadDot`
Parents
rCOMM832b471c0618: [native] Add some memoization to `InnerTextMessage` component
Branches
Unknown
Tags
Unknown