Question

I asked this in a comment, but I don't think I'm supposed to ask a second question commenting on the first one. I have AutoCompleteExtender and it is very slow.. The method that gets my list to fill the AutoCompleteExtender has to Get and Query XML from API everytime. The problem is my method, inside of this method I cannot access SessonState, Cookie, even variables from static methods on the same page, so I see no alternative to GET and Query every time. This is SLOW though, really not worth having. There has to be another way (maybe not using the AJAX toolkit) to get this to run fast.

[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static List<string> GetNames(string prefixText, int count)
 {
    //Code Here Takes long
 }
Was it helpful?

Solution

Editing CompletionInterval , CompletionSetCount, and MinimumPerfixLength does close to nothing.

It looks like this is a very common problem - AJAX TextboxCompleteExtender being very slow because it queries data everytime - CodePlex has an awesome opensource solution to this problem if anyone else encounters it.

OTHER TIPS

You need to figure out where is your performance bottle neck before heading onto any specific solution. This will help you where do you need to make changes/fixes to increase the lookup.

There Are two sides you need to check (assuming you have a fast connection) :

  1. Server side: Make sure your server quickly returns the call. Try returning a small array of strings (Don't perform any back end data retrieval). If performance increases significantly it means you have a problem in your service/data layer code and you need to optimize its performance.

  2. Client side: One of the biggest factor on the client side is the CompletionInterval property. The default value set by Visual studio is 1000 ms. I changed it to 10, and it became much faster.

In my case, the bottleneck was in the control configuration itself; my server side was already fast because I used a trie structure for fast backend data lookup and retrieval. I also returned a small array of records, turned client side caching on. The biggest factor was CompletionInterval though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top