The search / typing performance is terrible for the core Select component when we get over 10K items (with 100K options we are talking 1-3 seconds per keystroke).
In this PR
I am moving the option filtering to be outside the Select component, and limiting the options we pass to the Select component to 10K.
Using uFuzzy for the actual filtering.
Adding a new demo to test a variable with many options
in order to properly memoize the uFuzzy instance, allOptions, haystack etc I created a new function called getOptionSearcher which replaces some of the logic we had in getOptionsForSelect. Added the same tests we have for getOptionsForSelect to the getOptionSearcher (plus a search test). The GroupBy variable is still using getOptionsForSelect (and I think it might be used by scene app plugins also), so not sure we can remove it. I can refactor a bit so that getOptionsForSelect i using getOptionSearch under the hood.
Anyway this PR radically improves search / typing performance (and menu open perf) going from 1-3 seconds per keystroke to ~50-100ms
The search / typing performance is terrible for the core Select component when we get over 10K items (with 100K options we are talking 1-3 seconds per keystroke).
In this PR
Anyway this PR radically improves search / typing performance (and menu open perf) going from 1-3 seconds per keystroke to ~50-100ms