Question: I'm making an app that can search Metacritic (screen-scraper app). In the search box, I have an autocomplete function, which essentially does exactly what pressing "Search" would do, which is query Metacritic and populate a listview with the results. The problem is, since the app is a screen-scraping tool, it is not instant on autocomplete like Google.

Since the autocomplete is fired on keyup (every time the value of the text field changes essentially), since it is slow, when the user finishes typing, it updates the listview a bunch of times as it keeps searching, so it keeps changing which is quite annoying as it fetches the next results. Is there a good way to get around this?

I was thinking having it only query every *other* keypress, so that it wouldn't update as much and therefore wouldn't be as blinky.

**Update:**

This fix isn't necessarily perfect, but it helps a tremendous amount. What I did was:

a) Not fire the query until the length of the text field is at least 3
b) Fire *every other* keypress

This removed most of the blinking.

Answer: 
If auto-complete is slow, you can do several things: 

1. best option is to switch it off. Each user knows better than computer, what he wants to write
2. Optimize software which is providing the auto-complete method. Common problem is, that values are read from files, then parsed, sorted, searched and after all that displayed every time a-c is accessed.
3. Enable caching on auto-complete. Usually there are serious slowdowns, when auto-complete list should be read from the hard-drive or downloaded from Internet.
4. **Edited** Enable pre-indexing. Let's have list of the a-c words extracted in the memory or quick access table in db with simple alphabetic or weight index, include background actualization according dynamic changes of the application. Enable most searched words first etc.

Unfortunately, you did not describe exactly what is the application with slow a-c, therefore it is hard to give more detailed answer.

**Edited**: Question is what makes your query slow. Target optimizations to that.
Do you perform the search in a separate thread, so that it doesn't block the UI? If not, do this first.

Then, when results come in, don't show them if the user has already typed further characters. This should prevent the annoying multiple updates.