asp.net - Iterating over SearchResultCollection is Very Slow -


i'm running ldap query returns multiple entries , stores them inside searchresultcollection. i'm iterating on searchresultcollection so:

// results searchresultcollection object foreach (searchresult sr in results)   {     ... things each searchresult in here ... } 

this seems logical way this, loop incredibly slow. when step through loop debugger, find it's first step of initializing foreach loop takes time - actual iterations instantaneous.

in addition, when view contents of searchresultcollection while debugging, watch takes long load contents of variable.

i have theory searchresultcollection doesn't contain complete searchresult objects, rather references entries in active directory server individually fetched when iterate on searchresultcollection object. can confirm theory? , there better (faster) way fetch set of ldap entries?

there may ways decrease response time:

  • restrict scope of search
  • use more restrictive search filter
  • use base object closer object(s) being retrieved.

see also


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -