Hi,
The answer to your question is a bit difficult because it depends on the type of object, length of collection and operations that need to be done on the collection and even those operation`s frequency. But, to get a good landscape about the performance of collections in .Net I will redirect you to my article that shows you results of a benchmarking in this scope.
Large Collections in C# (Managed Code) - Part II[
^]
About only ArrayList vs List I should mention that ArrayList belongs to the time that.Net didn`t have generic List<t>. In fact, the List<t> supports storing values of a specific type without casting to or from the object (No boxing/unboxing overhead). ArrayList simply stores object references.
But, even if you don`t use the benefit of generic list and you create a list with a concrete object type still List<t> is better than ArrayList because of several reasons such as:
1- Low overhead in Add method. The ArrayList has more expensive Add method due to checking
Contract.Ensures()
2- The
List<T>
implements the
IReadOnlyList<T>
while the
ArrayList
does not. This intefece is very useful when you would like to construct a readonly collection.
3- I would recommand you see the implementation of each of which.
ArrayList vs
List<t>
If this did not solve your problem then please leave a comment and I will assist you by improving my solution until your problem gets solved.
Cheers,
AH