On Wed, 7 Jan, 2004 09:21 -0500, Scott A. Lawrence <[EMAIL PROTECTED]>
wrote:

> I used the tracing functionality built into ASP.NET.  The process of
> populating the DataTable with the contents of the ArrayList is what is
> taking up the majority of the time.

But are you sure that the UserDirectoryObjects actually contain the
properties pre-populated? 

I think Chad Gross has a point. 

On Tue, 6 Jan, 2004 16:01 -0500, Chad M. Gross <[EMAIL PROTECTED]>
wrote:

> Im not certain how your DirectoryEntry wrapper class
UserDirectoryObject
> is implemented but I would expect that it reads one property at a time
> from the DirectoryEntry object or loads them all or each one on demand
> from the UserDirectoryObject object.  I would expect that your
performance
> is due to reading from AD directly in your loop (lastName reading sn
and
> firstName reading givenName) vs. adding the rows since you can add at
> least 100,000 rows to a datatable in < 5 seconds on today's average PC
> hardware.

Is it possible that your object is lazy-loading the properties and only
populating them when accessed in the loop?

Also, is it a MarshalByRefObject accessed on a remote server? If so,
individual property accesses can eat up a lot of time via multiple
network round trips.

An easy test would be to profile the code looping through the user list
without adding rows to a DataTable.

  foreach (UserDirectoryObject user in userList)
  {
    string lastName = user.lastName;   //must access property to profile
    string firstName = user.firstName;
    // etc.

  }

Michael

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to