I have an "autocomplete" textbox that will invoke a WCF method each time a key is pressed. The WCF server, in turn, will run an SQL query, return the first 15 results and send them. However, this results in a noticeable latency when typing in the box.
What I'm about to do instead is this:
Is there a better approach or is this the way to go?
So basically wait for 1 second for the user to stop typing before requesting results.
That's a good solution for conserving server resources, but you are actually adding latency by making the user wait for a minimum of 1000ms.
My guess is that your original issue was that this is a winforms app and the request you made was synchronous by default. As a result, the textbox wasn't accepting user input while the app was waiting for a response. Just making the call asynchronous should solve that issue without making the typing slower.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With