Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: improve performance #4552

Merged
merged 9 commits into from
Jan 31, 2025
Merged

perf: improve performance #4552

merged 9 commits into from
Jan 31, 2025

Conversation

WofWca
Copy link
Collaborator

@WofWca WofWca commented Jan 24, 2025

Review commit-by-commit recommended.

...wherever possible.

FullChat is quite heavy because of `contacts`, so it'd be nice
to get rid of it wherever possible, for performance.
By replacing `getFullChatById` with `getBasicChatInfo`.
By using `getBasicChatInfo` instead of `getFullChatById`.
...wherever possible. Such that `getBasicChatInfo()` is preferred
over `getFullChatById()`.
Switch `useState` to `useRef`
This is a follow-up to 41231e0
(#4145).
@WofWca
Copy link
Collaborator Author

WofWca commented Jan 29, 2025

Rebased

Copy link
Member

@nicodh nicodh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by reading.

The changes for switchedChatAt from useState to useRef seem reasonable, although I did not really investigate the whole scroll behaviour

@WofWca
Copy link
Collaborator Author

WofWca commented Jan 31, 2025

The changes for switchedChatAt from useState to useRef seem reasonable, although I did not really investigate the whole scroll behaviour

Yes, the idea is that switchedChatAt is only read in the event listener, and does not affect the render output.

@WofWca WofWca merged commit 8173117 into main Jan 31, 2025
11 of 12 checks passed
@WofWca WofWca deleted the wofwca/some-perf branch January 31, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants