tags:

views:

562

answers:

3
+1  A: 

Two things:

  1. You only ever care about 1 entry. That code looks like it would return all the results for a particular query. You might try hunting around for a single-result query style.
  2. Failing that, I doubt there's much you can do to make this particular bit a code easier on the server. You might see if there's some way you can call this function less often- perhaps by caching the results.
Joel Coehoorn
A: 

I agree with Joel Coehoorn. If you're running searches often, you might want to cache the results. Apart from that, I can't see what might be wrong.

Patrik
A: 

Good information. Thanks for the quick response.

Well.... I think am in the midst of a full on developer vs. admin war. The Linux admin claims his stuff is set up, and we (me and my co-workers) are claiming that our stuff is not overloading the server. Ironically, if I point my app to one of our LDAP mirrors, running top shows that the load on the server that I change it to does not match the load on the LDAP server that isn't working. Nonetheless, I am trying my best to comply with their demands.

Anyway, I'm definitely going to look into caching the results. Is there a built in way that .NET auto-magically does this that you know of, or would you recommend I create some sort of in memory table for it?

regex
Would have to be a memory table
Joel Coehoorn