Collections & VB.NET

samsmithnz

Senior Contributor
Joined
Jul 22, 2003
Messages
1,038
Location
Boston
I've always used collections with my applications, I've enjoyed the dynamic aspect, not found in an array.

I'm never had any problems with them in VB6, they've always been very fast, But as I move to VB.NET, I'm curious about the speed of a collection and how it relates to other .NET structures ( such as ArrayLists).

I can't seem to find any Microsoft Whitepapers, but has anyone else had any experience with .NET structures and their processing speeds?

Sam
 
I use them in games, so I'd say they are qutie fast. An ArrayList is basically just a linked list with some added bells and whistles.
 
Collections in .NET Framework sdk are Interfaces, the base interface for collections is System.Collections.Collectionbase,
all the objects that have Index as default property and the standard methods like Add... RemoveAT... are implementeds with the CollectionBase interface.

The threatments of objects inserted in a Collection are the same of visual basic 6.0, for most capabilityes...
The collectionbase just save addresses of objects, and in little cases , the valueof, ( example int16 ) .

the speed is depending on other factors... you can manage 10, 100 , 1000 objects and save them addresses in a collection, or in an array... or dont archive it , but the speed of the application will be slow if for example your objects make the garbage collector work too much.

PS: the current operatives systems have the support for old use of dlls... and the framework have a very different way of work, you will see the real power of the framework on windows.net
 
Back
Top