We working on a client/server project, where the service reads objects
from a certain organizational unit in the active directory and returns
the data via XML to a client. Both sides of the application have been
developed in Delphi 7 in win32 (unmanaged) code using API calls. The
server application, which interfaces with the Active Directory is run
on the only Domain Controller in the domain. The client is connected to
a 100Mbps network close to the server. The server enumerates the
objects using the "LDAP://" provider.
At first, enumerating (just enumerating, not sending) the
organizational unit in the active directory took about 26s using the
win32 exe. We then commented out the lines asking to retrieve each
users GUID and SamUsername and the query came down to about 4s. (I
would still like to know why this happens ?!)
Next, we packaged the entire project into a NT service. The service
works great, except that its is about 2.5X slower than the win32 exe.
Here are some comparison figures:
Win32 EXE Service
Enumerating 4000 users: 3.468s 8.563s
Creating XML Message: 1.032s 0.859s
Sending XML via TCP: 0.792s 2.125s
I don't quite understand why the networking takes longer with service,
but 1s is the least of my problem. I cannot understand why the ADSI
would take longer. And I need to sort this out, because some of our
clients are located on a slower network and their domains typically
contain many thousands of users in one organizational unit.
Can anyone please offer me an explanation or a solution.
Thanks in advance.