Always getting great help from here.
I posted a question about using AutoCompleteExtender. It simply shows users all available email addresses when they type in a letter(prefix).
It works, but the problem is it loads to late :( takes around 5 seconds to pull out the list.
So I would like to optimize this, (Might be a algorithm problem) please analze my code and give me some advices.
Any advices would be really great. Thank you genius!!
The part I would like to optimize speed is:
public static string GetCompletionList(string prefixText, int count)
items = new List<string>(500);
//Pull out all email addresses from our active directory
DirectorySearcher dSearch = new DirectorySearcher();
string str = dSearch.SearchRoot.Path;
DirectoryEntry entry = new DirectoryEntry(str);
dSearch.Filter = "(objectClass=user)";
foreach (SearchResult sResultSet in dSearch.FindAll())
if (sResultSet.Properties["mail"].Count > 0)
View Complete Post