HomePhabricator
Diffusion Comm 46ac62ee6866

[native] Memoize `PanGestureHandler` props in `SwipeableMessage`

Tags
None
Referenced Files
F736395: 6b03c7.png
Sep 5 2023, 11:34 AM
File Not Attached
Subscribers
None

Description

[native] Memoize PanGestureHandler props in SwipeableMessage

Summary:
Based on flamegraph from profiler, it looks like A. creating SwipeSnakes and PanGestureHandler in SwipeableMessage is expensive B. because we're not memoizing things as carefully as we could be we're eating this cost multiple times.

In this diff I just memoize the PanGestureHandler props. In the subsequent diff I'll add some more memoization to this component specifically wrt the SwipeSnakes


Depends on D9052

Test Plan:
"Before":

6b03c7.png (1×2 px, 530 KB)

Will do another round of profiling after the subsequent diff to show improvement.

Reviewers: ginsu, tomek, rohan

Reviewed By: tomek

Subscribers: ashoat

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

Details

Provenance
atulAuthored on Sep 5 2023, 11:29 AM
Reviewer
tomek
Differential Revision
D9053: [native] Memoize `PanGestureHandler` props in `SwipeableMessage`
Parents
rCOMM7d901c25c45e: [native] Convert `ComposedMessage` into a functional component
Branches
Unknown
Tags
Unknown