Is there a performance advantage for using DirectorySearcher on SearchRequest for LDAP queries

I understand that System.DirectoryServices is a "higher level" System.DirectoryServices.Protocols and abstracts some complexity.

Whether there are any other performance benefits or not, use System.DirectoryServices.DirectorySearcher and System.DirectoryServices.Protocols.SearchRequest for .NET LDAP queries.

What criteria will allow you to use one approach over another?

+4
source share
1 answer

Over the past few months I have been dealing with two libraries, I can say that there are big differences, especially if you are dealing with large data sets. This blog post describes just a few of the issues, and once I figure out LDAP instances with over 500,000 entries, I can vouch for accuracy.

The System.DirectoryServices namespace uses a lot of ADSI and COM below the surface, which can add a lot of overhead, especially when disposing of objects. System.DirectoryServices.Protocols interacts directly with the API, a low level of LDAP, which gives you much more control and much better interaction with non-Microsoft directories.

If all you are trying to achieve is some quick and easy connection to an AD / ADAM / ADLDS instance for relatively simple operations, it might be worth sticking to this namespace - otherwise, I would strongly recommend that you invest time in learning the protocol namespace. I found this MSDN article to be a huge help when I was studying initially. - it covers almost everything you need to know

+9
source

Source: https://habr.com/ru/post/1307095/


All Articles