Places:AutoComplete: Difference between revisions

Fill in optimizations information
(Fill in optimizations information)
 
Line 77: Line 77:


== Stop searching when there's enough results ==
== Stop searching when there's enough results ==
Instead of finding many pages that match a search query, we stop early when we have at least as many results that will be shown. This allows for a more responsive UI as we finish processing a chunk before notifying the listener that we have results.
== Reuse existing results when filtering more ==
== Reuse existing results when filtering more ==
Every time we find matching pages, we keep track of those URLs so that the next query can start searching from those matched pages. This is useful when the user types an additional character at the end of the query.
Additionally, we track which chunk we stopped at for the previous query and continue from that chunk if we start from the previously matched URLs. This is possible because an additional character in the query will not match anything a previous query didn't match.
== Don't search if it won't find anything ==
== Don't search if it won't find anything ==
If there were no previously matching URLs and the search has completely finished searching through all places, we can immediately say that there will be no results when the user types more. This is useful for users typing in a new URL either editing an existing URL or typing a brand new one.
383

edits