Remove search debounce (2x+ speedup) #2412
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I tested this locally with about 30 seconds of typing at a rate of 30 characters per second (60 if you count the backspace as a character) when using both short and long queries on the docs.julialang.org search target. I noticed no disruptions that the comments warn about. I was testing on chromium as that browser allows me to edit javascript live, it would be nice to also test on another browser and to hear why @Hetarth02 chose to include these debounces in the first place to make sure this doesn't create instability or performance issues, especially on slow computers and/or mobile (though folks don't type particularly quickly on mobile)
This should make search at least 2x faster and, I'd extrapolate, sometimes more than 10x faster (e.g. when there are very few search terms or for packages with small indexes). It entirely removes the 300ms wait between when the user finishes typing and when we begin gathering search results.
Fixes #2411
Supersedes & closes #2407