HomePhabricator
Diffusion Comm 29810a4822ce

[native] Add some memoization to `ColorSplotch`

Description

[native] Add some memoization to ColorSplotch

Summary:
Based on profiling, re-renders of ColorSplotch are expensive because of the SVGs within. Because we were passing squircleParams to SquircleView as raw object, ColorSplotch got recreated every time.

I think we should just get rid of SquircleView altogether and just use the more performant View. We only use SquircleView (via ColorSplotch) in UnreadDot and ThreadSettings... neither of which are places where the distinction between squircle, circle, or rounded rectangle really matter. For context, we originally used Squircle for ColorSplotchs that appear where user/thread avatars appear today.


Depends on D9070

Test Plan: Things continue to work as expected.

Reviewers: tomek, rohan, ginsu

Reviewed By: tomek

Subscribers: ashoat

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

Details

Provenance
atulAuthored on Sep 1 2023, 3:18 PM
Reviewer
tomek
Differential Revision
D9071: [native] Add some memoization to `ColorSplotch`
Parents
rCOMM8d3568785056: [native] Add some memoization to `UnreadDot`
Branches
Unknown
Tags
Unknown