Skip to content

Conversation

juliusv
Copy link
Member

@juliusv juliusv commented May 10, 2025

Moving the debouncing of the search field to the parent component and then memoizing the ScrapePoolsList component prevents a lot of superfluous re-renders of the entire scrape pools list that previously got triggered immediately when you typed in the search box or even just collapsed a pool. (While the computation of what data to show was already memoized in the ScrapePoolList component, the component itself still had to re-render a lot with the same data.)

Discovered this problem + verified fix using react-scan.

Moving the debouncing of the search field to the parent component and then
memoizing the ScrapePoolsList component prevents a lot of superfluous
re-renders of the entire scrape pools list that previously got triggered
immediately when you typed in the search box or even just collapsed a pool.
(While the computation of what data to show was already memoized in the
ScrapePoolList component, the component itself still had to re-render a lot
with the same data.)

Discovered this problem + verified fix using react-scan.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
@juliusv juliusv requested a review from Nexucis May 10, 2025 12:21
@juliusv
Copy link
Member Author

juliusv commented May 10, 2025

I've tried to restart the failed Netlify checks (they failed due to a temporary name resolution failure), but it doesn't seem like the statuses get updated here 🤷‍♂️

@Nexucis Nexucis merged commit 5c06804 into main May 12, 2025
41 of 45 checks passed
@Nexucis Nexucis deleted the memoize-targets branch May 12, 2025 08:40
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