Speed of iterating thru, binding Arraylist vs datatable

  • Thread starter Thread starter Brian Link
  • Start date Start date
B

Brian Link

I've been using typed arraylists inherited from collectionbase to hold
my in-memory lists of data. Sometimes they can be relatively large
(200 bytes X 10000 records). I've either iterated through the list and
added to listviews or treeviews, and occasionally bound them to
datagrids.

Lately I've been experimenting with datatables & dataviews for the
same purpose. I was wondering what people's experiences have been with
either approach, in respect to performance. The .NET data objects have
a lot of appealing built-in features such as sorting and filtering,
but at what cost to performance?

Thanks for any ideas.

Brian Link, Minnesota Countertenor
----------------------------------
"There are things that we know, and then there are known
unknowns. That is to say, there are things that we now
know that we don't know. But there are also unknown unknowns.
There are things we do not know we don't know."
- U.S. War Secretary, 2003
 
Hi Brian,

There seem to be two approaches, but when I see in time in this newsgroups,
in my opinion the persons who did first everyting with arrays (iList) go
more and more to the dataset and the datatables.

They are so easy to handle (and in my opinion fast but I did never comparise
them real in a test)

A real test should be very hugh and complex.

When you than look what you have to do for a test comparing the sort from
both using the Icomparer for all columns of an array of objects and the
dataview for a datatable, I think you decide than fast.

Just my 2 eurocents.

Cor
 
Is there any limit to the size of dataset - I am processing IIS logs with
nearly a million rows. Currently I am loading it into a MSDE database and
running sql queries against it.

I wonder is datasets are the way to go?

Brian
 
Hi Brian,

When I see this I have always to think about Bernie Yaeger, he is using I
thought datasets with 15000 rows.

I nowhere have seen size limits, however I do not know that and the limit of
your physical memory will of course be forever.

Cor
 
Hi Brian,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you want to know the performance
different between ArrayList and Datatable.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

Based on my experience, the ArrayList is somewhat better than datatable
with regard to performance, due to its simple implement contrast to
datatable,but datatable provide more methods.

So choice will be made due to what do you want to do.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top