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 performance of sidebar filter UI #1232

Merged
merged 1 commit into from
Nov 19, 2020
Merged

Conversation

jameshadfield
Copy link
Member

The previous implementation of the sidebar filtering was slow to respond to keystrokes for large datasets. This was because of two implementation decisions: (i) the list of available filters was computed upon every key-stroke and (ii) the matching algorithm was run against this. A subsequent key-stroke wouldn't appear until both steps had completed.

Here we improve (i) by precomputing the options at component render time, and improve (ii) by debouncing the matching algorithm and not ignoring accents. (Profiling indicated that the stripping of accents took a lot of time.) By using an Async React Select component we get a spinner UI to indicate that the result of the matching algorithm is being awaited.

The previous implementation of the sidebar filtering was slow to respond to keystrokes for large datasets. This was because of two implementation decisions: (i) the list of available filters was computed upon every key-stroke and (ii) the matching algorithm was run against this. A subsequent key-stroke wouldn't appear until both steps had completed.

Here we improve (i) by precomputing the options at component render time, and improve (ii) by debouncing the matching algorithm and not ignoring accents. (Profiling indicated that the stripping of accents took a lot of time.) By using an Async React Select component we get a spinner UI to indicate that the result of the matching algorithm is being awaited.
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.

1 participant