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

Improve recalculation of filtering (sidebar) options #1882

Open
jameshadfield opened this issue Oct 31, 2024 · 0 comments
Open

Improve recalculation of filtering (sidebar) options #1882

jameshadfield opened this issue Oct 31, 2024 · 0 comments

Comments

@jameshadfield
Copy link
Member

Originally part of #1878

The sidebar filtering component <FilterData> updates on any filter change (not date range). Each time it calls its makeOptions method which recomputes all options (to show in the dropdown), even though most of them are unchanged. In particular, calling collectGenotypeStates can be expensive and is completely unnecessary. Depending on the size of the tree and the number of attributes to be searched on each node this can be expensive and result in the filtering dropdown appearing janky¹. We should be able to use prop diffing to only recompute what has (or may have) changed.

Note: the options are calculated every render time, but we're debouncing the callback which hands them to . Can't we just defer the calculation of options to this callback?

¹ This will also relate to the rendering component we use, and we should also look into profiling and improving that, either here or elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant