New MSDN article (flaw?)
-
I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph: Object Collections and Object Arrays When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes: * An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. * Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array. * If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection. I am bugged by the first bullet point here... Sounds very wrong to me...
-
I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph: Object Collections and Object Arrays When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes: * An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. * Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array. * If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection. I am bugged by the first bullet point here... Sounds very wrong to me...
Ray Cassick wrote: An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. :laugh: Evidently an array is faster either way. I'm thinking the Collection will be faster for random access, but I wouldn't swear to that. Paul
-
I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph: Object Collections and Object Arrays When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes: * An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. * Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array. * If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection. I am bugged by the first bullet point here... Sounds very wrong to me...
Ray Cassick wrote: An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster. Correction: Collections are usually implemented using linked lists. Both linked lists and arrays provide fast sequential access. But for random access, arrays are faster. "In an organization, each person rises to the level of his own incompetence." Peter's Principle